Details
-
Bug
-
Resolution: Unresolved
-
Neutral
-
None
-
2.0.4
-
None
-
None
Description
Magnolia is sending body in request even when no body property is defined in rest client definition.
Some APIs are not behaving properly when sending a GET with an empty body, especially when content type header is set to application/json.
We are facing this issue with BSI calls, please see below some samples :
This is the regular GET without body, it works fine
curl --location --request GET 'https://partner.bsi-software.com/trial/studio215/inbound/default/e/l/insurance-demo-user-old?customerNo=343&firstName=Bartosz&lastName=Staryga&email=bartoszstaryga%40gmail.com¬es=Travel%2C%2CHousing' \ --header 'Content-Type: text/plain'
Then a GET with empty body, with header Content-Type set to text/plain, it still works
curl --location --request GET 'https://partner.bsi-software.com/trial/studio215/inbound/default/e/l/insurance-demo-user-old?customerNo=343&firstName=Bartosz&lastName=Staryga&email=bartoszstaryga%40gmail.com¬es=Travel%2C%2CHousing' \ --header 'Content-Type: text/plain' \ --data ''
And now GET with empty body, with header Content-Type set to application/json, doesn’t work. This is basically how magnolia rest client is sending the request.
curl --location --request GET 'https://partner.bsi-software.com/trial/studio215/inbound/default/e/l/insurance-demo-user-old?customerNo=343&firstName=Bartosz&lastName=Staryga&email=bartoszstaryga%40gmail.com¬es=Travel%2C%2CHousing' \ --header 'Content-Type: application/json' \ --data ''
Please find the following PR as a candidate to fix this issue, by not sending body when no body property is declared in the rest client definition:
https://git.magnolia-cms.com/projects/MODULES/repos/rest-client/pull-requests/155/overview
Checklists
Attachments
Issue Links
- relates to
-
MGNLRESTCL-148 RestEasy not allow to do GET request with a body
-
- Open
-