Skip to content
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

net/http: TimeoutHandler with header argument #46721

Closed
bentcoder opened this issue Jun 12, 2021 · 3 comments
Closed

net/http: TimeoutHandler with header argument #46721

bentcoder opened this issue Jun 12, 2021 · 3 comments
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@bentcoder
Copy link

Hi,

Is it possible to add headers argument to http.TimeoutHandler method as well?

For instance currently I am using it like below but the header defaults to text/html; charset=utf-8 :(

http.TimeoutHandler(
    handler,
    timeout,
    `{"code":"service_unavailable","message":"The server cannot handle the request"}`,
)

If I gave chance to set the message, would have given chance to set the header too.

Thanks

@seankhliao seankhliao changed the title Feature request: http.TimeoutHandler with header argument net/http: TimeoutHandler with header argument Jun 12, 2021
@seankhliao seankhliao added FeatureRequest NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jun 12, 2021
@seankhliao
Copy link
Member

Duplicate of #22821

@neild

This comment has been minimized.

@neild neild reopened this Oct 21, 2021
@neild
Copy link
Contributor

neild commented Oct 21, 2021

Actually, on second thought, I'm just going to retitle the other issue. Most of the discussion there is about finding a way to set the content type, not update the documentation.

@neild neild closed this as completed Oct 21, 2021
@golang golang locked and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FeatureRequest FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants