graphql-http 1.22.2 → 1.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/handler.js CHANGED
@@ -19,9 +19,9 @@ function isResponse(val) {
19
19
  return false;
20
20
  // Make sure the contents of init match ResponseInit
21
21
  const init = val[1];
22
- if (typeof init.status !== 'number')
22
+ if (init.status && typeof init.status !== 'number')
23
23
  return false;
24
- if (typeof init.statusText !== 'string')
24
+ if (init.statusText && typeof init.statusText !== 'string')
25
25
  return false;
26
26
  if (init.headers && !(0, utils_1.isObject)(init.headers))
27
27
  return false;
package/lib/handler.mjs CHANGED
@@ -16,9 +16,9 @@ function isResponse(val) {
16
16
  return false;
17
17
  // Make sure the contents of init match ResponseInit
18
18
  const init = val[1];
19
- if (typeof init.status !== 'number')
19
+ if (init.status && typeof init.status !== 'number')
20
20
  return false;
21
- if (typeof init.statusText !== 'string')
21
+ if (init.statusText && typeof init.statusText !== 'string')
22
22
  return false;
23
23
  if (init.headers && !isObject(init.headers))
24
24
  return false;
@@ -23,6 +23,7 @@ function createHandler(options) {
23
23
  // if body is null, return undefined
24
24
  body: body !== null && body !== void 0 ? body : undefined,
25
25
  statusCode: init.status,
26
+ headers: init.headers,
26
27
  };
27
28
  }
28
29
  catch (err) {
@@ -20,6 +20,7 @@ export function createHandler(options) {
20
20
  // if body is null, return undefined
21
21
  body: body !== null && body !== void 0 ? body : undefined,
22
22
  statusCode: init.status,
23
+ headers: init.headers,
23
24
  };
24
25
  }
25
26
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphql-http",
3
- "version": "1.22.2",
3
+ "version": "1.22.4",
4
4
  "description": "Simple, pluggable, zero-dependency, GraphQL over HTTP spec compliant server, client and audit suite.",
5
5
  "keywords": [
6
6
  "graphql",