Sending OS information in DoH header

This commit is contained in:
Cuong Manh Le
2023-09-22 11:19:22 +00:00
committed by Cuong Manh Le
parent a9959a6f3d
commit 34758f6205
6 changed files with 113 additions and 1 deletions
+23
View File
@@ -0,0 +1,23 @@
package ctrld
import (
"runtime"
"testing"
)
func Test_dohOsHeaderValue(t *testing.T) {
val := dohOsHeaderValue()
if val == "" {
t.Fatalf("empty %s", dohOsHeader)
}
t.Log(val)
encodedOs := EncodeOsNameMap[runtime.GOOS]
if encodedOs == "" {
t.Fatalf("missing encoding value for: %q", runtime.GOOS)
}
decodedOs := DecodeOsNameMap[encodedOs]
if decodedOs == "" {
t.Fatalf("missing decoding value for: %q", runtime.GOOS)
}
}