mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
all: adding more function/type documentation
This commit is contained in:
committed by
Cuong Manh Le
parent
c941f9c621
commit
542c4f7daf
@@ -13,10 +13,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DoHMacHeader = "x-cd-mac"
|
||||
DoHIPHeader = "x-cd-ip"
|
||||
DoHHostHeader = "x-cd-host"
|
||||
|
||||
dohMacHeader = "x-cd-mac"
|
||||
dohIPHeader = "x-cd-ip"
|
||||
dohHostHeader = "x-cd-host"
|
||||
headerApplicationDNS = "application/dns-message"
|
||||
)
|
||||
|
||||
@@ -101,13 +100,13 @@ func addHeader(ctx context.Context, req *http.Request, sendClientInfo bool) {
|
||||
if sendClientInfo {
|
||||
if ci, ok := ctx.Value(ClientInfoCtxKey{}).(*ClientInfo); ok && ci != nil {
|
||||
if ci.Mac != "" {
|
||||
req.Header.Set(DoHMacHeader, ci.Mac)
|
||||
req.Header.Set(dohMacHeader, ci.Mac)
|
||||
}
|
||||
if ci.IP != "" {
|
||||
req.Header.Set(DoHIPHeader, ci.IP)
|
||||
req.Header.Set(dohIPHeader, ci.IP)
|
||||
}
|
||||
if ci.Hostname != "" {
|
||||
req.Header.Set(DoHHostHeader, ci.Hostname)
|
||||
req.Header.Set(dohHostHeader, ci.Hostname)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user