Skip to content

Commit

Permalink
PR #103 from (feature/updates)
Browse files Browse the repository at this point in the history
Feature/updates
  • Loading branch information
aichholzer authored Mar 16, 2020
2 parents a435c83 + 3fd3671 commit c0a7145
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: node_js
node_js:
- "8"
- "10"
- "11"
- "12"

after_script:
- npm run report
Expand Down
6 changes: 5 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ try {
.through(signature.bind(null, cometa))
.get('/:provider/*', (req, res, step) => {
try {
const request = Object.assign({}, parse(req), cometa);
const request = {
...parse(req),
...cometa
};

if (request.output.extension instanceof Error) {
return step(request.output.extension.message, 409);
}
Expand Down
1 change: 1 addition & 0 deletions app/providers/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module.exports = class S3 extends Readable {
this.on('end', () => this.emit('provided', 'Image received from S3 provider.'));
}

// eslint-disable-next-line no-underscore-dangle
_read() {
this.S3.getObject({ Bucket: this.aws.bucket, Key: this.input }, (error, data) => {
if (error) {
Expand Down
1 change: 1 addition & 0 deletions app/providers/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = class URL extends Readable {
this.on('end', () => this.emit('provided', 'Image received from URL provider.'));
}

// eslint-disable-next-line no-underscore-dangle
_read() {
const protocol = /https/.test(this.inputUrl.protocol) ? 'https' : 'http';
require.call(null, protocol).get(this.inputUrl, (res) => {
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Cometa",
"version": "1.3.0",
"version": "1.3.1",
"description": "Super fast, on-demand and on-the-fly, image processing server.",
"main": "app/index.js",
"engines": {
Expand All @@ -20,26 +20,26 @@
"license": "MIT",
"homepage": "https://github.com/CometaFront/Cometa",
"dependencies": {
"aws-sdk": "^2.411.0",
"rayo": "^1.3.3",
"sharp": "^0.22.0"
"aws-sdk": "^2.639.0",
"rayo": "^1.3.5",
"sharp": "^0.25.1"
},
"devDependencies": {
"codecov": "^3.2.0",
"coveralls": "^3.0.2",
"dotenv": "^8.0.0",
"eslint": "^5.14.1",
"eslint-config-airbnb-base": "^13.0.0",
"eslint-config-prettier": "^5.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-prettier": "^3.0.1",
"mocha": "^6.0.2",
"nodemon": "^1.18.10",
"npm-check": "^5.9.0",
"nyc": "^14.1.1",
"prettier": "^1.16.4",
"codecov": "^3.6.5",
"coveralls": "^3.0.9",
"dotenv": "^8.2.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-prettier": "^3.1.2",
"mocha": "^7.1.0",
"nodemon": "^2.0.2",
"npm-check": "^5.9.2",
"nyc": "^15.0.0",
"prettier": "^1.19.1",
"should": "^13.2.3",
"sinon": "^7.2.5"
"sinon": "^9.0.1"
},
"directories": {
"test": "test"
Expand Down
5 changes: 4 additions & 1 deletion test/unit/lib/signature.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ module.exports = () => {

it('Signature (allowUnauthorized)', (done) => {
const req = fake.req();
const cometa = Object.assign({}, config.cometa, { allowUnauthorized: true });
const cometa = {
...config.cometa,
...{ allowUnauthorized: true }
};

const response = signature(cometa, req, fake.res(), (message) => message || 'Pass');

Expand Down

0 comments on commit c0a7145

Please sign in to comment.