Socket
Socket
Sign inDemoInstall

@hapi/ammo

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/ammo - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

33

lib/index.js

@@ -11,10 +11,11 @@ 'use strict';

internals.Range = class {
// RFC 7233 (https://tools.ietf.org/html/rfc7233#appendix-D)
//
// Range = "bytes" "=" byte-range-set
// byte-range-set = *( "," OWS ) byte-range-spec *( OWS "," [ OWS byte-range-spec ] )
// byte-range-spec = ( 1*DIGIT "-" [ 1*DIGIT ] ) / ( "-" 1*DIGIT )
constructor(from, to) {
this.from = from;
this.to = to;
}
};
// 12 3 3 4 425 6 7 7 8 865 1
internals.headerRx = /^bytes=[\s,]*((?:(?:\d+\-\d*)|(?:\-\d+))(?:\s*,\s*(?:(?:\d+\-\d*)|(?:\-\d+)))*)$/i;

@@ -26,6 +27,4 @@

const parts = header.split('=');
if (parts.length !== 2 ||
parts[0] !== 'bytes') {
const parts = internals.headerRx.exec(header);
if (!parts) {
return null;

@@ -42,6 +41,2 @@ }

for (let range of ranges) {
if (range.length === 1) { // '-'
return null;
}
let from;

@@ -106,2 +101,12 @@ let to;

internals.Range = class {
constructor(from, to) {
this.from = from;
this.to = to;
}
};
exports.Clip = class extends Stream.Transform {

@@ -108,0 +113,0 @@

{
"name": "@hapi/ammo",
"description": "HTTP Range processing utilities",
"version": "4.0.0",
"version": "4.0.1",
"repository": "git://github.com/hapijs/ammo",

@@ -6,0 +6,0 @@ "main": "lib/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