-
Notifications
You must be signed in to change notification settings - Fork 211
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
[ECP-9599]Implement the tracking of Headless requests to the FrontEndType header #2897
base: main
Are you sure you want to change the base?
Conversation
if (str_contains($requestUri, '/graphql')) { | ||
$frontendType = 'headless-graphql'; | ||
} else { | ||
$frontendType = 'headless-rest'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Express payments will fall under headless-rest
category unless we indicate the frontendType
in additional_data
of place order functions of express method renderers. This might require some data clean-up to remove express payments from headless-rest
payments. However, it would become cumbersome after having a huge data set. We can merge this as it is but until fixing it on express payment module, we will get some dirty data. Could you please check this with product?
Helper/Data.php
Outdated
if (is_null($frontendType)) { | ||
// Check the request URI | ||
$requestUri = $this->request->getPathInfo(); | ||
if (str_contains($requestUri, '/graphql')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logical comparison might create false-positives. Let's discuss it separately.
|
Description
This PR aims tracking the Headless Frontend type requests, If it is Graphql requests, the
EXTERNAL_PLATFORM_FRONTEND_TYPE
will be set asheadless-graphql
and falling back to REST Headless for all other remaining scenarios with the value set asheadless-rest
Tested scenarios
Fixes