aws / aws/aws-xray-sdk-node

Wrong http.request.url reported when host header is set

Open
#401 3 comments 0 reactions 1 assignee Claimed by @willarmiros View on GitHub
enhancement
Dominant language
JavaScript
Stars
280
Forks
157
PR merge metrics
No merged PRs in 30d

Description

Sometimes it is useful to connect to a url and have a different host header:

```
The "Host" header field in a request provides the host and port
information from the target URI, enabling the origin server to
distinguish among resources while servicing requests for multiple
host names on a single IP address.
```
https://tools.ietf.org/html/rfc7230#section-5.4

When this is the case, the reported `http.request.url` contains the host header instead of the host from the connecting url.

For example:

```
fetch("http://url.example/path", { headers: { host: "host.example" }})
```

would be reported as `http://host.example/path` instead of `http://url.example/path`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.