@orbiting/backend-modules-assets
Advanced tools
Comparing version 1.0.3 to 1.0.5
@@ -1,6 +0,21 @@ | ||
<a name="1.0.3"></a> | ||
## 1.0.3 (2018-01-14) | ||
<a name="1.0.5"></a> | ||
## 1.0.5 (2018-01-16) | ||
<a name="1.0.4"></a> | ||
## 1.0.4 (2018-01-16) | ||
<a name="1.0.4"></a> | ||
## 1.0.4 (2018-01-16) | ||
### Bug Fixes | ||
* whitelist gif images ([43d0535](https://github.com/orbiting/backend-modules/commit/43d0535)) | ||
<a name="1.0.3"></a> | ||
@@ -7,0 +22,0 @@ ## 1.0.3 (2018-01-14) |
@@ -27,3 +27,3 @@ const sharp = require('sharp') | ||
if (width > maxSize || height > maxSize) { | ||
throw new Error('maxSize: '+ maxSize) | ||
throw new Error('maxSize: ' + maxSize) | ||
} | ||
@@ -42,3 +42,3 @@ return { | ||
height = dimensions.height | ||
} catch(e) { | ||
} catch (e) { | ||
res.status(400).end(e.message) | ||
@@ -50,2 +50,8 @@ } | ||
const isGIF = type && type.ext === 'gif' | ||
if (isGIF) { | ||
return res.end(buffer) | ||
} | ||
if (width || height || isJPEG) { | ||
@@ -132,3 +138,3 @@ let image = sharp(buffer) | ||
if (!mac || mac !== authenticate(url)) { | ||
console.warn('unauthorized asset url requested: '+url) | ||
console.warn('unauthorized asset url requested: ' + url) | ||
return res.status(403).end() | ||
@@ -138,3 +144,3 @@ } | ||
const buffer = await fetch(url, { | ||
method: 'GET', | ||
method: 'GET' | ||
}) | ||
@@ -149,3 +155,2 @@ .then(response => response.buffer()) | ||
}) | ||
} |
{ | ||
"name": "@orbiting/backend-modules-assets", | ||
"version": "1.0.3", | ||
"version": "1.0.5", | ||
"description": "server assets", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9370
238
2