Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@httpland/accept-ranges-parser
Advanced tools
HTTP Accept-Ranges header field parser.
Compliant with RFC 9110, 14.3. Accept-Ranges.
Parses string into AcceptRanges.
import { parseAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/parse.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals(parseAcceptRanges(`none`), ["none"]);
assertEquals(parseAcceptRanges(`bytes, unknown`), ["bytes", "unknown"]);
Throws SyntaxError
if the input is invalid
<Accept-Ranges>
syntax.
import { parseAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/parse.ts";
import { assertThrows } from "https://deno.land/std/testing/asserts.ts";
assertThrows(() => parseAcceptRanges("<invalid>"));
Serialize string of array into string.
import { stringifyAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/stringify.ts";
import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
assertEquals(stringifyAcceptRanges(["bytes"]), "bytes");
Throws TypeError
if the element contains invalid
<range-unit>
syntax.
import { stringifyAcceptRanges } from "https://deno.land/x/accept_ranges_parser@$VERSION/stringify.ts";
import { assertThrows } from "https://deno.land/std/testing/asserts.ts";
assertThrows(() => stringifyAcceptRanges(["<invalid>", "none"]));
AcceptRanges
is a subtype of array with the following characteristics.
Represents a character set that compliant with RFC 9110, 5.6.2. Tokens as much as possible.
All APIs can be found in the deno doc.
Copyright © 2023-present httpland.
Released under the MIT license
FAQs
HTTP Accept-Ranges header field parser
The npm package @httpland/accept-ranges-parser receives a total of 14 weekly downloads. As such, @httpland/accept-ranges-parser popularity was classified as not popular.
We found that @httpland/accept-ranges-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.