Skip to content

Commit

Permalink
Merge pull request #29 from cyberixae/retain_status_code_of_http_resp…
Browse files Browse the repository at this point in the history
…onse

Retain status code of http response
  • Loading branch information
cyberixae authored Aug 10, 2023
2 parents 09d0528 + 430d3d4 commit 0a3f7bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "io-ts-rpc",
"version": "0.0.9",
"version": "0.0.10",
"description": "Remote procedure calls with io-ts decoder/encoder support",
"license": "MIT",
"keywords": [
Expand Down
5 changes: 3 additions & 2 deletions src/tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import { validator } from 'io-ts-validator';

import { Endpoint } from './endpoint';
import { Errors, singleError } from './err';
import { Body, Fetch, Headers, Method } from './fetch';
import { Body, Fetch, FetchResult, Headers, Method } from './fetch';
import * as Headers_ from './headers';
import { URI, URITemplate } from './uri-template';
import * as URITemplate_ from './uri-template';

type HTTPRequest = { url: URI; method: Method; headers: Headers; body: Body };
type HTTPResponse = { headers: Headers; body: Body };
type HTTPResponse = { status: FetchResult['status']; headers: Headers; body: Body };

type HTTPExchange = {
request: HTTPRequest;
Expand Down Expand Up @@ -181,6 +181,7 @@ export function tunnel<
return {
request: encoded,
response: {
status: result.status,
headers: {
...implicit,
...explicit,
Expand Down

0 comments on commit 0a3f7bd

Please sign in to comment.