Skip to content

Geo IP only works with stores belong to websites which the request was made from. #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kavingas opened this issue Jul 18, 2022 · 3 comments

Comments

@kavingas
Copy link

Steps

  • Create 2 or more websites with store views
  • Configure Fastly GeoIP redirect to redirect requests to a different store that belongs to a website other than the request was made from
  • Access the store using an IP matching the GeoIP redirect rule

Actual Result
The request is not getting redirected

Expected Result
The request matching the GeoIP should get redirected to the desired store.

Extra details
The code under https://github.com/fastly/fastly-magento2/blob/master/Model/Config.php#L1155 checks whether the target store belongs to the same website that the request was made from.

@o-rykh
Copy link

o-rykh commented Aug 24, 2022

This issue happens because GeoIP feature is relay on X-Magento-Vary or form_key cookies. See:
https://github.com/fastly/fastly-magento2/blob/master/etc/vcl_snippets/recv.vcl#L112-L114
Both cookies are intended to be used by internal Magento features only and are set or not based on those features' needs. Fastly GeoIP or any other 3rd party libraries shouldn't rely on any Magento cookie, including mentioned X-Magento-Vary cookie.

@vvuksan
Copy link
Contributor

vvuksan commented Aug 26, 2022

We'll look into it. It may take a bit as there is quite a bit of risk involved.

vvuksan added a commit that referenced this issue Sep 12, 2022
Proposed fix for #549 as submitted by customer
@vvuksan
Copy link
Contributor

vvuksan commented Oct 6, 2022

Released in 1.2.188

@vvuksan vvuksan closed this as completed Oct 13, 2022
MickaelDatadome pushed a commit to DataDome/fastly-magento2 that referenced this issue Oct 5, 2023
MickaelDatadome added a commit to DataDome/fastly-magento2 that referenced this issue Oct 5, 2023
Co-authored-by: Shohei Maeda <[email protected]>
Co-authored-by: Domagoj Potkoc <[email protected]>
Co-authored-by: kirgiv4oja <[email protected]>
Co-authored-by: Vladimir Vuksan <[email protected]>
Co-authored-by: Pawel Siejba <[email protected]>
Co-authored-by: Andrew Kett <[email protected]>
Co-authored-by: Peter Dohogne <[email protected]>
Co-authored-by: Lex <[email protected]>
Co-authored-by: Dan Wallis <[email protected]>
Co-authored-by: Sean <[email protected]>
Co-authored-by: Domagoj Potkoc <[email protected]>
Co-authored-by: Jack Scotson <[email protected]>
Co-authored-by: Bohdan Korablov <[email protected]>
Co-authored-by: github-actions <smaeda-ks [email protected]>
Co-authored-by: Alejandro Marroni <[email protected]>
Co-authored-by: github-actions <vvuksan [email protected]>
Co-authored-by: Vladimir Vuksan <[email protected]>
Co-authored-by: Joao Oliveira Pereira <[email protected]>
Co-authored-by: Borna Butkovic <[email protected]>
Co-authored-by: Frangolacci Sebastien <[email protected]>
Co-authored-by: Borzas Laszlo <[email protected]>
Co-authored-by: mizdebski-netacea <[email protected]>
Co-authored-by: Pawel Siejba <[email protected]>
Co-authored-by: ivanviduka <[email protected]>
Co-authored-by: Lauredg <[email protected]>
Co-authored-by: Lauredg <[email protected]>
Fix unset req.http.graphql
fix typo (fastly#464)
fix Fastly const value ti int value fastly#466
fix plugin annotation fastly#466
fix fastly#466
fixing old value in core_config_data fastly#466
fix type check in Image (fastly#472)
fix config save - image optimization fastly#476
Fix ambiguous behavior in Blocking toggle (fastly#479)
Fix type check (fastly#483)
Fix bugs in upadte backend dialog (fastly#487)
Fix for: GetUpdateFlag call flushes all configuration fastly#499
Fix for fastly#504
fix for fastly#520
fixing duplicate line reported under issue#518
Fix fastly#393
fix fastly#393
Fix javascript fastly#544
fix fastly#551
fix getImageOptimization - Deprecated Functionality: explode(): Passing null to parameter #2
fix for fastly#549 as submitted by customer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants