mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 22:34:02 +03:00
Add v2 network package
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package network
|
||||
|
||||
import "net/http"
|
||||
|
||||
type networkHTTPTransport struct {
|
||||
userAgent string
|
||||
next http.RoundTripper
|
||||
}
|
||||
|
||||
func (n networkHTTPTransport) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
req.Header.Set("User-Agent", n.userAgent)
|
||||
|
||||
return n.next.RoundTrip(req) //nolint: wrapcheck
|
||||
}
|
||||
Reference in New Issue
Block a user