Skip to content

Commit

Permalink
Fix mapUri type definition (#137)
Browse files Browse the repository at this point in the history
It's used with `await`, so it may return a promise or non-promise value.
The examples in API.md return a non-promise.
  • Loading branch information
joshkel committed Aug 10, 2023
1 parent 9331f02 commit f7d77a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ declare namespace h2o2 {
*/
passThrough?: boolean | undefined;
/**
* if set tofalse, any locally defined state is removed from incoming
* if set to false, any locally defined state is removed from incoming
* requests before being sent to the upstream service. This value can be
* overridden on a per state basis via the server.state()``passThrough
* option.
Expand Down Expand Up @@ -125,7 +125,7 @@ declare namespace h2o2 {
* together with `host`, `port`, `protocol`, or `uri`.
* @param request - is the incoming request object.
*/
mapUri?: ((this: ProxyHandlerOptions, request: Request) => Promise<ProxyTarget>) | undefined;
mapUri?: ((this: ProxyHandlerOptions, request: Request) => ProxyTarget | Promise<ProxyTarget>) | undefined;
/**
* a custom function which is passed the upstream request.
* @param req - the [wreck] (https://github.com/hapijs/wreck) request to the upstream server.
Expand Down

0 comments on commit f7d77a0

Please sign in to comment.