Details
Description
Some Product Catalog endpoints (for example /product/catalog/products - https://doc.ibexa.co/en/latest/api/rest_api/rest_api_reference/rest_api_reference.html#product-catalog-load-products-list ) return an error response when the application is using Varnish.
Steps to reproduce:
1. Execute the following script:
HOST="YOUSITE_BEHIND_VARNISH.example.com/api/ibexa/v2" ADMIN_PASSWORD="publish" # Setup: REST login RESPONSE=$(curl --request POST "$HOST/user/sessions" \ --header 'Accept: application/vnd.ibexa.api.Session+json' \ --header 'Content-Type: application/vnd.ibexa.api.SessionInput+json' \ --data-raw "{ \"SessionInput\": { \"login\": \"admin\", \"password\": \"$ADMIN_PASSWORD\" } }") SESSION_NAME=$(echo "$RESPONSE" | jq -r ".Session.name") SESSION_IDENTIFIER=$(echo "$RESPONSE" | jq -r ".Session.identifier") curl --request GET "$HOST/product/catalog/products" \ --header 'Accept: application/vnd.ibexa.api.ProductListGet+json' \ --header 'Content-Type: application/vnd.ibexa.api.ProductListGet+json' \ --header 'X-Siteaccess: site' \ --header "Cookie: $SESSION_NAME=$SESSION_IDENTIFIER" \ --data-raw '{"ProductListGet": {"offset": 0, "limit": 100,"languages": ["eng-GB"]}}'
Expected:
Valid response is returned
Actual:
{"ErrorMessage":{"_media-type":"application\/vnd.ibexa.api.ErrorMessage+json","errorCode":400,"errorMessage":"Bad Request","errorDescription":"An error occured while decoding the JSON input:\nSyntax error\nInput JSON:\n\n"}}%
This happens both with Varnish locally and on Platform.sh