@netlify/functions
Advanced tools
Comparing version 0.7.3-streaming.3 to 0.7.3-streaming.4
@@ -5,3 +5,3 @@ { | ||
"types": "./src/main.d.ts", | ||
"version": "0.7.3-streaming.3", | ||
"version": "0.7.3-streaming.4", | ||
"description": "JavaScript utilities for Netlify Functions", | ||
@@ -8,0 +8,0 @@ "files": [ |
/* eslint-disable no-underscore-dangle , promise/prefer-await-to-callbacks, */ | ||
// @ts-check | ||
const { Buffer } = require('buffer') | ||
const http = require('http') | ||
@@ -15,2 +14,3 @@ const https = require('https') | ||
outgoingMessage | ||
METADATA_BOUNDARY = `___x_nf-metadata_boundary-${Date.now()}` | ||
@@ -22,2 +22,3 @@ constructor(url) { | ||
this.outgoingMessage = parsedUrl.protocol === 'https:' ? https.request(url) : http.request(url) | ||
this.outgoingMessage.setHeader('x-nf-metadata-boundary', this.METADATA_BOUNDARY) | ||
this.pipe(this.outgoingMessage) | ||
@@ -35,7 +36,7 @@ } | ||
_getMetadata() { | ||
return JSON.stringify({ | ||
return `${JSON.stringify({ | ||
// eslint-disable-next-line node/no-unsupported-features/es-builtins | ||
headers: Object.fromEntries(this._clientHeaders.entries()), | ||
statusCode: this.statusCode, | ||
}) | ||
})}\r\n${this.METADATA_BOUNDARY}` | ||
} | ||
@@ -46,3 +47,3 @@ | ||
super.write(this._getMetadata()) | ||
super.write(Buffer.from([0x00])) | ||
// super.write(Buffer.from([0x00])) | ||
this._metadataSent = true | ||
@@ -49,0 +50,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14161
271