0

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
2
  • 1
    %3C and %3E would 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. Commented Dec 16, 2024 at 14:02
  • "on the second attempt" means you are requesting the exact same URL as the first time, and that URL wasn't modified in any way on the client side in between? Your responses appear to contain a Location header - 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. Commented Dec 16, 2024 at 14:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.