mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
Merge branch 'master' into bs/cell-blobpool/sparse-v2
This commit is contained in:
commit
f4577def19
3 changed files with 6 additions and 1 deletions
|
|
@ -463,6 +463,7 @@ func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
// Either invalid (too many colons) or no port specified
|
||||
host = r.Host
|
||||
}
|
||||
host = strings.ToLower(host)
|
||||
if ipAddr := net.ParseIP(host); ipAddr != nil {
|
||||
// It's an IP address, we can serve that
|
||||
h.next.ServeHTTP(w, r)
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ func TestVhosts(t *testing.T) {
|
|||
resp := rpcRequest(t, url, testMethod, "host", "test")
|
||||
assert.Equal(t, resp.StatusCode, http.StatusOK)
|
||||
|
||||
respUpper := rpcRequest(t, url, testMethod, "host", "TeSt:1234")
|
||||
assert.Equal(t, respUpper.StatusCode, http.StatusOK)
|
||||
|
||||
resp2 := rpcRequest(t, url, testMethod, "host", "bad")
|
||||
assert.Equal(t, resp2.StatusCode, http.StatusForbidden)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,8 +196,9 @@ func MetadataFromContext(ctx context.Context) Metadata {
|
|||
if info.Transport != "" {
|
||||
if info.Transport == "http" {
|
||||
m.Scheme = info.HTTP.Version
|
||||
} else {
|
||||
m.Scheme = info.Transport
|
||||
}
|
||||
m.Scheme = info.Transport
|
||||
}
|
||||
if info.RemoteAddr != "" {
|
||||
m.Remote = info.RemoteAddr
|
||||
|
|
|
|||
Loading…
Reference in a new issue