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

got

Package Overview
Dependencies
Maintainers
2
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

got - npm Package Compare versions

Comparing version 12.0.3 to 12.0.4

2

dist/source/core/index.d.ts

@@ -124,4 +124,2 @@ /// <reference types="node" />

unpipe<T extends NodeJS.WritableStream>(destination: T): this;
private _lockWrite;
private _unlockWrite;
private _finalizeBody;

@@ -128,0 +126,0 @@ private _onResponseBase;

@@ -204,20 +204,2 @@ import process from 'node:process';

this._stopRetry = noop;
const unlockWrite = () => {
this._unlockWrite();
};
const lockWrite = () => {
this._lockWrite();
};
this.on('pipe', (source) => {
source.prependListener('data', unlockWrite);
source.on('data', lockWrite);
source.prependListener('end', unlockWrite);
source.on('end', lockWrite);
});
this.on('unpipe', (source) => {
source.off('data', unlockWrite);
source.off('data', lockWrite);
source.off('end', unlockWrite);
source.off('end', lockWrite);
});
this.on('pipe', source => {

@@ -254,8 +236,5 @@ if (source.headers) {

}
const { json, body, form } = this.options;
if (json || body || form) {
this._lockWrite();
}
// Important! If you replace `body` in a handler with another stream, make sure it's readable first.
// The below is run only once.
const { body } = this.options;
if (is.nodeStream(body)) {

@@ -497,13 +476,2 @@ body.once('error', error => {

}
_lockWrite() {
const onLockedWrite = () => {
throw new TypeError('The payload has been already provided');
};
this.write = onLockedWrite;
this.end = onLockedWrite;
}
_unlockWrite() {
this.write = super.write;
this.end = super.end;
}
async _finalizeBody() {

@@ -569,8 +537,2 @@ const { options } = this;

}
else if (cannotHaveBody) {
this._lockWrite();
}
else {
this._unlockWrite();
}
if (options.responseType === 'json' && !('accept' in options.headers)) {

@@ -836,14 +798,9 @@ options.headers.accept = 'application/json';

}
else {
this._unlockWrite();
if (!is.undefined(body)) {
this._writeRequest(body, undefined, () => { });
currentRequest.end();
this._lockWrite();
}
else if (this._cannotHaveBody || this._noPipe) {
currentRequest.end();
this._lockWrite();
}
else if (!is.undefined(body)) {
this._writeRequest(body, undefined, () => { });
currentRequest.end();
}
else if (this._cannotHaveBody || this._noPipe) {
currentRequest.end();
}
}

@@ -850,0 +807,0 @@ _prepareCache(cache) {

2

package.json
{
"name": "got",
"version": "12.0.3",
"version": "12.0.4",
"description": "Human-friendly and powerful HTTP request library for Node.js",

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

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