cleanup: merge httpheader and httpfailure into model (#758)

These two small packages could easily be merged into the model
package, since they're clearly model-like packages.

Part of https://github.com/ooni/probe/issues/2115
This commit is contained in:
Simone Basso
2022-05-25 09:54:50 +02:00
committed by GitHub
parent 928de50145
commit 2d721baa91
20 changed files with 74 additions and 90 deletions
+3 -4
View File
@@ -26,7 +26,6 @@ import (
"unicode/utf8"
"github.com/lucas-clemente/quic-go"
"github.com/ooni/probe-cli/v3/internal/engine/httpheader"
"github.com/ooni/probe-cli/v3/internal/model"
"github.com/ooni/probe-cli/v3/internal/netxlite"
"github.com/ooni/probe-cli/v3/internal/runtimex"
@@ -289,9 +288,9 @@ func NewCookieJar() http.CookieJar {
// the headers are the ones we use for measuring.
func NewHTTPRequestHeaderForMeasuring() http.Header {
h := http.Header{}
h.Set("Accept", httpheader.Accept())
h.Set("Accept-Language", httpheader.AcceptLanguage())
h.Set("User-Agent", httpheader.UserAgent())
h.Set("Accept", model.HTTPHeaderAccept)
h.Set("Accept-Language", model.HTTPHeaderAcceptLanguage)
h.Set("User-Agent", model.HTTPHeaderUserAgent)
return h
}