Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ghost-storage-adapter-s3-bartt

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ghost-storage-adapter-s3-bartt - npm Package Compare versions

Comparing version 0.1.8-development to 0.1.9-development

15

index.js

@@ -40,2 +40,5 @@ 'use strict';

};
var stripQueryParameters = function stripQueryParameters(s) {
return s.indexOf('?') > 0 ? s.substring(0, s.indexOf('?')) : s;
};

@@ -200,3 +203,3 @@ class Store extends _ghostStorageBase2.default {

Bucket: _this5.bucket,
Key: stripLeadingSlash(stripEndingSlash(_this5.pathPrefix) + req.path)
Key: stripLeadingSlash((0, _path.join)(stripEndingSlash(_this5.pathPrefix), stripQueryParameters(req.path)))
}).on('httpHeaders', function (statusCode, headers, response) {

@@ -217,11 +220,5 @@ return res.set(headers);

return new Promise(function (resolve, reject) {
// remove trailing slashes
var path = (options.path || '').replace(/\/$|\\$/, '');
var path = stripLeadingSlash(stripEndingSlash(stripQueryParameters(options.path)));
path = (0, _path.join)(stripEndingSlash(_this6.pathPrefix), path);
// check if path is stored in s3 handled by us
if (!path.startsWith(_this6.host)) {
reject(new Error(`${path} is not stored in s3`));
}
path = path.substring(_this6.host.length);
_this6.s3().getObject({

@@ -228,0 +225,0 @@ Bucket: _this6.bucket,

2

package.json

@@ -77,3 +77,3 @@ {

},
"version": "0.1.8-development"
"version": "0.1.9-development"
}

@@ -11,2 +11,3 @@ import AWS from 'aws-sdk'

const stripEndingSlash = s => s.indexOf('/') === (s.length - 1) ? s.substring(0, s.length - 1) : s
const stripQueryParameters = s => s.indexOf('?') > 0 ? s.substring(0, s.indexOf('?')) : s

@@ -158,3 +159,3 @@ class Store extends BaseStore {

Bucket: this.bucket,
Key: stripLeadingSlash(stripEndingSlash(this.pathPrefix) + req.path)
Key: stripLeadingSlash(join(stripEndingSlash(this.pathPrefix), stripQueryParameters(req.path)))
})

@@ -174,11 +175,5 @@ .on('httpHeaders', (statusCode, headers, response) => res.set(headers))

return new Promise((resolve, reject) => {
// remove trailing slashes
let path = (options.path || '').replace(/\/$|\\$/, '')
let path = stripLeadingSlash(stripEndingSlash(stripQueryParameters(options.path)))
path = join(stripEndingSlash(this.pathPrefix), path)
// check if path is stored in s3 handled by us
if (!path.startsWith(this.host)) {
reject(new Error(`${path} is not stored in s3`))
}
path = path.substring(this.host.length)
this.s3()

@@ -185,0 +180,0 @@ .getObject({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc