Skip to content

Host header is missing from the Headers section #61

Open

Description

@sashee

When I send a request with a different Host header then the request is logged successfully but the Host is missing.

curl -H "Host: example.com" https://rbaskets.in/3vgdn65

Shows:

image

Testing with webhooks.site the host header is listed:

image

This prevents debugging host-related issues.

Activity

  1. darklynx commented on Aug 2, 2020

    @darklynx
    Owner

    This is a result of Go-lang net/http library behavior, see https://golang.org/src/net/http/request.go#L159

    // For incoming requests, the Host header is promoted to the
    // Request.Host field and removed from the Header map.

    :(

    On the other hand the Request.Host field does not contain a host header only instead it is defined as following: https://golang.org/src/net/http/request.go#L221

    TL;DR: if Host-header is not defined, Request.Host will contain a host part of the URL the request was made to :(

    In order to expose Host-header properly I need to find out how to either get an access to the raw HTTP-request, or how to figure out that Request.Host field contains the host header and not the part of URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugConfirmed bug or issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions