We have following persisted query:
The GraphQL query has the parameter "startsWith" which takes a path like this:
query getArticlesByPath($startsWith: ID!) {
articleCfmList(filter: {
_path: {
_expressions: [
{
value: $startsWith
_operator: STARTS_WITH
}]
}
}) {
items {
...
It works perfectly fine on author and publisher but when sending the same request to the dispatcher it will not send the request correctly to the publisher because the encoded path is not correctly transmitted.
We have tried it with directive
AllowEncodedSlashes NoDecode
but it didn't help. What is the correct dispatcher setting for these kind of parameters?
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
Please check this documentation: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap... In short, the encoding should happen before hitting the dispatcher, in other words, the URL should reach the dispatcher already encoded, if you use the AEM headless client SDK, this will encode the URL for you. The dispatcher should not change this encode unless you have intentionally indicated the opposite.
The AllowEncodedSlashes
directive is used to control whether encoded slashes (%2F or %2f) in URLs are allowed or not. By default, Apache does not allow encoded slashes in URLs due to security concerns.
Hope this helps.
Hi,
Please check this documentation: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap... In short, the encoding should happen before hitting the dispatcher, in other words, the URL should reach the dispatcher already encoded, if you use the AEM headless client SDK, this will encode the URL for you. The dispatcher should not change this encode unless you have intentionally indicated the opposite.
The AllowEncodedSlashes
directive is used to control whether encoded slashes (%2F or %2f) in URLs are allowed or not. By default, Apache does not allow encoded slashes in URLs due to security concerns.
Hope this helps.
Hi @EstebanBustamante ,
sorry for the late reply and thank you for the hints. I could solve the problem with it.
The problem was that this request
became this
So the dispatcher encoded the already encoded slash (%2F) again (%252F). I had a look into the Cloud SDK dispatcher and found this peace of code:
# SITES-3659 Prevent re-encodes of URLs sent to GraphQL Persisted Queries API endpoint
<LocationMatch "/graphql/execute.json/.*">
ProxyPassMatch http://${AEM_HOST}:${AEM_PORT} nocanon
</LocationMatch>
I've adjusted it for my dispatcher and now it works.
@12nalk123 Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.
Views
Replies
Total Likes
Views
Likes
Replies