Skip to content

net/http/httputil: ReverseProxy should use StatusBadGateway if backend can't be connected #9864

@porjo

Description

@porjo

When using net/http/httputil ReverseProxy where the upstream server is, for example, refusing connections the HTTP status code returned is StatusInternalServerError. It would be more appropriate (and helpful to the client) to return StatusBadGateway.

Looking at the underlying code for http.Transport, it looks like there is no way to differentiate between the two classes of error at the moment.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions