mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-12-29 10:04:49 -05:00
Fixed HttpResponseOptions
being ignored
The problem here is that the spread operator doesn't work with getters. Thus, if an instance implementing the `HttpResponseOptions` interface with getters instead of regular readonly fields is supplied to the method, it won't function as expected, even though TypeScript's static typing indicates that everything should be fine.
This commit is contained in:
parent
577191382f
commit
4b559b054a
1 changed files with 1 additions and 1 deletions
|
@ -213,7 +213,7 @@ export class HttpResponse {
|
|||
headers.set("Content-Type", contentType);
|
||||
}
|
||||
|
||||
return new Response(data, { ...options, headers }) as NodeFetchResponse;
|
||||
return new Response(data, { status: options?.status, statusText: options?.statusText, headers }) as NodeFetchResponse;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue