How to get the users country via CDN header?

Avatar

Avatar
Affirm 5
Level 4
TB3dock
Level 4

Likes

37 likes

Total Posts

223 posts

Correct reply

5 solutions
Top badges earned
Affirm 5
Ignite 10
Boost 25
Give Back 25
Validate 10
View profile

Avatar
Affirm 5
Level 4
TB3dock
Level 4

Likes

37 likes

Total Posts

223 posts

Correct reply

5 solutions
Top badges earned
Affirm 5
Ignite 10
Boost 25
Give Back 25
Validate 10
View profile
TB3dock
Level 4

28-06-2021

with Episerver cloud, the backend code simply reads the clients country code from the CF-IPCountry header which cloudflare puts on to each request automatically. 

 

What do you get with AEM cloud?  it has flastly, which i understand has similar functionality to cloudflare?

 

Basically, we need block/route requests based on which country they are from, and do logic in our AEM app.

 

We wrote a simple servlet to dump the headers, deployed it to the cloud env, and then when we hit the servlet we dont see the x-aem-client-country header.  to fix we need to add it to clientheaders.any

 

 

 

 

 

 

 

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 7
Ritesh_M
Level 7

Likes

179 likes

Total Posts

142 posts

Correct reply

44 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile

Avatar
Boost 5
Level 7
Ritesh_M
Level 7

Likes

179 likes

Total Posts

142 posts

Correct reply

44 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 1
View profile
Ritesh_M
Level 7

28-06-2021

Hi @TB3dock ,

 

we have something called x-aem-client-country which you can get from request header for this.

 

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delive...

Answers (0)