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

unifile

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unifile - npm Package Compare versions

Comparing version 0.0.46 to 0.0.47

22

lib/core/middleware.js

@@ -20,3 +20,14 @@

function sendResponse (response, status, data, mime_type, responseFilePath) {
if (status && status.success===false){
// warn if headers have been sent already
if (response.headerSent === true){
// this seems to happen with the FTP module
console.error('Error: sendResponse could not set headers because they have been sent already.', status);
}
// warn and stop if response has been sent already
if (response.finished === true){
// this seems to happen with the FTP module
console.error('Error: sendResponse could not send response because it has been sent already.', status);
return;
}
if (status && status.success === false){
var code;

@@ -34,7 +45,12 @@ if (status.code) code = status.code;

// mime type
response.setHeader('Content-Type', mime_type);
if(response.headerSent !== true) {
response.setHeader('Content-Type', mime_type);
}
}
else if (data){
// default mime type is json (only when the data is not a file, because files have their own content type)
response.setHeader('Content-Type', 'application/json; charset=utf8');
if(response.headerSent !== true) {
console.log('aaa');
response.setHeader('Content-Type', 'application/json; charset=utf8');
}
data = JSON.stringify(data);

@@ -41,0 +57,0 @@ }

2

package.json
{
"name": "unifile",
"description": "Express middleware to provide a common API for cloud storage services. ",
"version": "0.0.46",
"version": "0.0.47",
"author": {

@@ -6,0 +6,0 @@ "name": "Alex Hoyau aka lexoyo"

@@ -182,2 +182,3 @@ #Unifile, unified access to cloud storage services.

* doc: https://www.dreamfactory.com/developers/live_API
* mock, doc et tests: http://apiblueprint.org/
* https://npmjs.org/package/social-cms-backend

@@ -184,0 +185,0 @@ * tests http://stackoverflow.com/questions/11520170/unit-testing-oauth-js-with-mocha

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