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

http-types

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-types - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

3

dist/index.js

@@ -167,3 +167,2 @@ "use strict";

if (requestData.query) {
path += "?";
let first = true;

@@ -175,2 +174,3 @@ for (const key in requestData.query) {

first = false;
path += "?";
}

@@ -189,2 +189,3 @@ else {

first = false;
path += "?";
}

@@ -191,0 +192,0 @@ else {

{
"name": "http-types",
"version": "0.2.0",
"version": "0.3.0",
"description": "Library for JSON serialisation of HTTP exchanges",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -218,3 +218,2 @@ /** HTTP request method to indicate the desired action to be performed for a given resource. */

if (requestData.query) {
path += "?";
let first = true;

@@ -226,2 +225,3 @@ for (const key in requestData.query) {

first = false;
path += "?";
} else {

@@ -238,2 +238,3 @@ path += "&";

first = false;
path += "?";
} else {

@@ -240,0 +241,0 @@ path += "&";

@@ -156,1 +156,30 @@ import {

});
test("Http exchanges from JSON with pathname and no query parameter", () => {
const json = `{
"request": {
"protocol": "https",
"host": "example.com",
"timestamp": "2018-11-13T20:20:39+02:00",
"method": "post",
"headers": {
"accept": "*/*",
"multi-value": ["value1", "value2"]
},
"pathname": "/a/path",
"query": {},
"body": "a request body"
},
"response": {
"timestamp": "2019-11-13T20:20:39+02:00",
"statusCode": 404,
"headers": {
"content-length": "15",
"Upper-Case": "yes"
},
"body": "a response body"
}
}`;
const exchange = HttpExchangeReader.fromJson(json);
expect(exchange.request.path).toBe("/a/path");
});

Sorry, the diff of this file is not supported yet

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