Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/115344

Change subject: Fix address family determination in GeoIP cookie
......................................................................

Fix address family determination in GeoIP cookie

Follows Iea8941896.

Change-Id: Ifae2b75c9b75e9b3a151c1b4ca71ddc4ceb0f390
---
M templates/varnish/geoip.inc.vcl.erb
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/44/115344/1

diff --git a/templates/varnish/geoip.inc.vcl.erb 
b/templates/varnish/geoip.inc.vcl.erb
index 5d12d6e..424234e 100644
--- a/templates/varnish/geoip.inc.vcl.erb
+++ b/templates/varnish/geoip.inc.vcl.erb
@@ -148,18 +148,18 @@
                record = GeoIP_record_by_addr(gi, ip);
 
                if (record) {
-                       /* Set-Cookie: 
GeoIP=US:San_Francisco:37.7749:-122.4194:v6; path=/ */
+                       /* Set-Cookie: 
GeoIP=US:San_Francisco:37.7749:-122.4194:v4; path=/ */
                        snprintf(latlon, sizeof(latlon), "%.4f:%.4f", 
record->latitude, record->longitude);
                        cookie = VRT_WrkString(sp, "GeoIP=",
                                record->country_code,                   ":",
                                geo_sanitize_for_cookie(record->city),  ":",
                                latlon,                                 ":",
-                               AF_INET6 ? "v6" : "v4",                 "; 
path=/",
+                               (af == AF_INET6) ? "v6" : "v4",         "; 
path=/",
                                vrt_magic_string_end);
                        GeoIPRecord_delete(record);
                } else {
                        /* Set-Cookie: GeoIP=::::v6; path=/ */
-                       cookie = VRT_WrkString(sp, "GeoIP=::::", AF_INET6 ? 
"v6" : "v4",
+                       cookie = VRT_WrkString(sp, "GeoIP=::::", (af == 
AF_INET6) ? "v6" : "v4",
                                "; path=/", vrt_magic_string_end);
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/115344
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifae2b75c9b75e9b3a151c1b4ca71ddc4ceb0f390
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to