Fastly response headers

I am trying to get the header value for x-geoipcountry which is set by Fastly. I tried in BaseController.Initialize and RequestModelActionFilter.OnActionExecuting but no result :confused: Does anyone know where and how I can fetch this as early as possible in a Request?
image

Thanks in advance!

Litium version: [7.4.2]

Found any solution yet?

Hi Steve, unfortunately not :confused:

Do you see it in the Request object at all?

Even if Fastly respond with the GeoIP information it’s not sure that it is passed down to origin server, see Decorating origin requests with GeoIP | Fastly Developer Hub how you can forward the headers to origin server.

@steve.redstorm I have checked both Response and Request objects but I can’t see it in any of them.

@patric.forsgard We have the following code in the VCL, doesn’t it set the Respone headers?

# Snippet GeoLocationHeaders : 100
set resp.http.X-GeoIPCountry = client.geo.country_code;
set resp.http.X-GeoIPContinent = client.geo.continent_code;
# default response conditions

that sets the response header that are returned from Fastly, the one that you show in the screen capture above, not on the request down to the origin server. See the link in my previous comment what you need to add to include the geo information down to the origin server (origin = Litium application).

Japp, You were completly right about that. After setting those lines in the VCL I now get the GeoIP-data I need. Thanks a lot!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.