Browse Source

Fix determinimg the default hostname for cookies passthrough

DarthSim 2 months ago
parent
commit
1ece2bd29d
2 changed files with 5 additions and 1 deletions
  1. 2 1
      CHANGELOG.md
  2. 3 0
      cookies/cookies.go

+ 2 - 1
CHANGELOG.md

@@ -10,7 +10,8 @@
 - (pro) Change saturation adjustment algorithm to be more CIE-correct.
 
 ### Fixed
-- Fix setting the `Host` header via the `IMGPROXY_CUSTOM_REQUEST_HEADERS` config.
+- Fix determinimg the default hostname for cookies passthrough.
+- (pro) Fix setting the `Host` header via the `IMGPROXY_CUSTOM_REQUEST_HEADERS` config.
 
 ## [3.27.2] - 2025-01-27
 ### Fixed

+ 3 - 0
cookies/cookies.go

@@ -39,6 +39,9 @@ func JarFromRequest(r *http.Request) (*cookiejar.Jar, error) {
 		if len(host) == 0 {
 			host = r.Header.Get("Host")
 		}
+		if len(host) == 0 {
+			host = r.Host
+		}
 
 		if len(host) == 0 {
 			return jar, nil