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 3.1.1 to 3.1.2

24

lib/index.js

@@ -21,2 +21,13 @@ 'use strict';

// 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 )
// 12 3 3 4 425 6 7 7 8 865 1
internals.headerRx = /^bytes=[\s,]*((?:(?:\d+\-\d*)|(?:\-\d+))(?:\s*,\s*(?:(?:\d+\-\d*)|(?:\-\d+)))*)$/i;
exports.header = function (header, length) {

@@ -26,6 +37,4 @@

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

@@ -41,8 +50,3 @@ }

for (let i = 0; i < ranges.length; ++i) {
let range = ranges[i];
if (range.length === 1) { // '-'
return null;
}
for (let range of ranges) {
let from;

@@ -49,0 +53,0 @@ let to;

{
"name": "@hapi/ammo",
"description": "HTTP Range processing utilities",
"version": "3.1.1",
"version": "3.1.2",
"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