mirror of
https://github.com/SethCohen/github-releases-to-discord
synced 2026-09-14 20:13:23 +00:00
chore: updated dependencies
This commit is contained in:
-4
@@ -288,10 +288,6 @@ export const getNodeRequestOptions = request => {
|
||||
agent = agent(parsedURL);
|
||||
}
|
||||
|
||||
if (!headers.has('Connection') && !agent) {
|
||||
headers.set('Connection', 'close');
|
||||
}
|
||||
|
||||
// HTTP-network fetch step 4.2
|
||||
// chunked encoding is handled by Node.js
|
||||
|
||||
|
||||
+19
@@ -124,6 +124,25 @@ export default class Response extends Body {
|
||||
return response;
|
||||
}
|
||||
|
||||
static json(data = undefined, init = {}) {
|
||||
const body = JSON.stringify(data);
|
||||
|
||||
if (body === undefined) {
|
||||
throw new TypeError('data is not JSON serializable');
|
||||
}
|
||||
|
||||
const headers = new Headers(init && init.headers);
|
||||
|
||||
if (!headers.has('content-type')) {
|
||||
headers.set('content-type', 'application/json');
|
||||
}
|
||||
|
||||
return new Response(body, {
|
||||
...init,
|
||||
headers
|
||||
});
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return 'Response';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user