-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support overriding upstream HTTP method #134
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,7 +92,7 @@ internals.handler = function (route, handlerOptions) { | |||||
|
||||||
return async function (request, h) { | ||||||
|
||||||
const { uri, headers } = await settings.mapUri(request); | ||||||
let { uri, headers, method } = await settings.mapUri(request); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather keep it that way:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wait, will it break? I assumed the it fetches the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say it's working as expected: https://runkit.com/embed/03jrtcm2e10x There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! Reminder to self: Get my morning cup of coffee, before reviewing code. |
||||||
|
||||||
const protocol = uri.split(':', 1)[0]; | ||||||
|
||||||
|
@@ -168,7 +168,8 @@ internals.handler = function (route, handlerOptions) { | |||||
downstreamStartTime = process.hrtime.bigint(); | ||||||
} | ||||||
|
||||||
const promise = settings.httpClient.request(request.method, uri, options); | ||||||
method = method || request.method; | ||||||
kanongil marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
const promise = settings.httpClient.request(method, uri, options); | ||||||
|
||||||
request.events.once('disconnect', () => { | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a word that it defaults to the same verb as the route?