This is my API: *******/api/3-1-app-313a04d4-e556-4dc7-b90a-1a1d0b347368/deploy. It returns two statuses: 202 on the first attempt and 303 on the second.
The first attempt works fine, and I receive a proper response, but on the second attempt, it encounters a 404 error. Upon checking the logs, I noticed that some extra characters are added, like %3C3-1-app-313a04d4-e556-4dc7-b90a-1a1d0b347368**%3E**, at the front and back of the URL.
However, when I try again, it sometimes returns the correct 202 response. I tested this in both the browser and Postman, and they both give the same 404 error on the second attempt. But when I use curl, it works successfully for both attempts.
How to rectify this issue?
curl response:
HTTP/2 202
server: openresty/1.21.4.1
date: Mon, 16 Dec 2024 12:20:13 GMT
content-type: text/html; charset=utf-8
content-length: 44
location: /***/***/242407/status
{"message": "deploy scheduled successfully"}% ,
HTTP/2 303
server: openresty/1.21.4.1
date: Mon, 16 Dec 2024 12:20:29 GMT
content-type: text/html; charset=utf-8
content-length: 43
location: /***/***/242407/status ,
postman response:
{"message": "deploy scheduled successfully"} ,
404 Not Found
%3Cand%3Ewould be the URL-encoded versions of<and>, respectively. But from your description so far, it is quite impossible to tell what might be adding those and where.Locationheader - so my guess would be, that the response you are getting contains that faulty URL as the Location header value, and your browser/postman follow that redirect. So you'd have to look on the server side then, why you are getting this faulty redirect response.