ssl-proxy: unpin go

This commit is contained in:
Mario Rodas 2024-01-17 04:20:00 +00:00
parent c8c45511cd
commit e027727e75
3 changed files with 23 additions and 3 deletions

View File

@ -13,6 +13,10 @@ buildGoModule rec {
vendorHash = "sha256-310K9ZSxy/OQ4HYFCcHQaj4NQwzATrOZ2YkhiSkhY5I=";
patches = [
./go120-compatibility.patch
];
checkTarget = "test";
meta = with lib; {

View File

@ -0,0 +1,18 @@
Check whether User-Agent is defined before trying to override it
Since Go 1.20 [1], ReverseProxy no longer adds a User-Agent header to forwarded
requests.
[1] https://github.com/golang/go/commit/f001df540b3fc66a475985c1b7c810e7df063c8f
--- a/reverseproxy/reverseproxy.go
+++ b/reverseproxy/reverseproxy.go
@@ -32,7 +32,7 @@ func newDirector(target *url.URL, extraDirector func(*http.Request)) func(*http.
} else {
req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery
}
- if _, ok := req.Header["User-Agent"]; !ok {
+ if req.Header.Get("User-Agent") != "" {
// explicitly disable User-Agent so it's not set to default value
req.Header.Set("User-Agent", "")
}

View File

@ -42031,9 +42031,7 @@ with pkgs;
yazi = callPackage ../applications/file-managers/yazi { inherit (darwin.apple_sdk.frameworks) Foundation; };
ssl-proxy = callPackage ../tools/networking/ssl-proxy {
buildGoModule = buildGo119Module; # build fails with 1.20
};
ssl-proxy = callPackage ../tools/networking/ssl-proxy { };
code-maat = callPackage ../development/tools/code-maat {};