Socket
Socket
Sign inDemoInstall

rjweb-server

Package Overview
Dependencies
Maintainers
1
Versions
373
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rjweb-server - npm Package Compare versions

Comparing version 9.1.3 to 9.1.4

4

CHANGELOG.md
# Changelog
## 9.1.4
- Add `options.download` and `options.name` to `<HttpRequestContext>.printFile()`
## 9.1.3

@@ -4,0 +8,0 @@

4

lib/cjs/classes/request/HttpRequestContext.js

@@ -436,4 +436,4 @@ "use strict";

this.headers.set('content-length', fileStat.size.toString());
if (!this.headers.has('content-disposition') && this.headers.get('content-type') === 'application/octet-stream') {
this.headers.set('content-disposition', `attachment; filename="${path.basename(file)}"`);
if (!this.headers.has('content-disposition')) {
this.headers.set('content-disposition', `${options.download ?? this.headers.get('content-type') === 'application/octet-stream' ? 'attachment' : 'inline'}; filename="${options.name ?? path.basename(file)}"`);
}

@@ -440,0 +440,0 @@ }

{
"name": "rjweb-server",
"version": "9.1.3",
"version": "9.1.4",
"description": "Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

@@ -408,4 +408,4 @@ import { Status } from "../../types/global";

this.headers.set('content-length', fileStat.size.toString());
if (!this.headers.has('content-disposition') && this.headers.get('content-type') === 'application/octet-stream') {
this.headers.set('content-disposition', `attachment; filename="${path.basename(file)}"`);
if (!this.headers.has('content-disposition')) {
this.headers.set('content-disposition', `${options.download ?? this.headers.get('content-type') === 'application/octet-stream' ? 'attachment' : 'inline'}; filename="${options.name ?? path.basename(file)}"`);
}

@@ -412,0 +412,0 @@ }

{
"name": "rjweb-server",
"version": "9.1.3",
"version": "9.1.4",
"description": "Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

@@ -276,2 +276,13 @@ /// <reference types="node" />

/**
* The Name of the File (if not set, the basename of the file will be used)
*
* Only applied if the `content-disposition` header is not set and options.download is true
* @default path.basename(file)
* @since 9.1.4
*/ name?: string;
/**
* Whether to download the file or display it in the browser
* @default ctr.headers.get('content-type') === 'application/octet-stream'
*/ download?: boolean;
/**
* Whether some Content Type Headers will be added automatically

@@ -278,0 +289,0 @@ * @default true

{
"name": "rjweb-server",
"version": "9.1.3",
"version": "9.1.4",
"description": "Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS",

@@ -5,0 +5,0 @@ "main": "./lib/cjs/index.js",

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