diff --git a/nodejs-millstone-mime.patch b/nodejs-millstone-mime.patch new file mode 100644 index 0000000..5572b90 --- /dev/null +++ b/nodejs-millstone-mime.patch @@ -0,0 +1,19 @@ +commit a5498e95d873aa5a301930871f47173fc22134ca +Author: Tom Hughes +Date: Wed Oct 4 19:00:45 2017 +0100 + + Update for mime 2.x + +diff --git a/lib/millstone.js b/lib/millstone.js +index 01a59cf..7d35011 100644 +--- a/lib/millstone.js ++++ b/lib/millstone.js +@@ -315,7 +315,7 @@ function guessExtension(headers) { + if (headers['content-type'].indexOf('subtype=gml') != -1) { + return '.gml'; // avoid .xml being detected for gml + } +- var ext_no_dot = mime.extension(headers['content-type'].split(';')[0]); ++ var ext_no_dot = mime.getExtension(headers['content-type'].split(';')[0]); + var ext = '.'+ext_no_dot; + if (isValidExt(ext)) { + return ext; diff --git a/nodejs-millstone.spec b/nodejs-millstone.spec index 21a2e0b..dc35649 100644 --- a/nodejs-millstone.spec +++ b/nodejs-millstone.spec @@ -12,6 +12,8 @@ Source0: https://registry.npmjs.org/millstone/-/millstone-%{version}.tgz Patch0: nodejs-millstone-internet.patch # https://github.com/tilemill-project/millstone/pull/129 Patch1: nodejs-millstone-json.patch +# https://github.com/tilemill-project/millstone/pull/130 +Patch2: nodejs-millstone-mime.patch BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch @@ -42,6 +44,7 @@ flush can be used to clear the cache of a specific resource. %patch0 -p1 %endif %patch1 -p1 +%patch2 -p1 %nodejs_fixdep generic-pool "^2.0.3" %nodejs_fixdep mime "^2.0.3" %nodejs_fixdep sqlite3 ">= 2 < 4" @@ -73,6 +76,7 @@ cp -pr package.json bin lib %{buildroot}/%{nodejs_sitelib}/millstone %changelog * Wed Oct 4 2017 Tom Hughes - 0.6.17-8 +- Add patch for mime 2.x support - Fix npm(mime) dependency * Wed Oct 04 2017 Jared Smith - 0.6.17-7