usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.6k stars 1.27k forks source link

the presence of `//` make Bruno hit the right endpoint but not using the right request method #3422

Open stephane-archer opened 2 weeks ago

stephane-archer commented 2 weeks ago

I have checked the following:

Describe the bug

my env is:

baseUrl: http://localhost:80/

a POST on {{baseUrl}}/transcode-video results in the following response to the server:

Error: Invalid request method, found GET but expect POST

but a POST on {{baseUrl}}transcode-video result on a proper request.

So, the presence of // make Bruno hit the right endpoint but not using the right request method

.bru file to reproduce the bug

No response

Screenshots/Live demo link

Screenshot 2024-11-05 at 10 19 42 Screenshot 2024-11-05 at 10 20 00
anusree-bruno commented 2 weeks ago

Hi @stephane-archer,

The "Invalid request method: found GET but expected POST" error might be specific to your server. Could you check if this response only occurs within Bruno?

Additionally, the issue with the extra / in the baseUrl generated during OpenAPI import will be resolved soon. I’ll keep you updated.

stephane-archer commented 2 weeks ago

The server only despond to one endpoint, the other endpoints is not handled. Other tools don't trigger the server with the // in the URL Only Bruno does with a GET request while a POST request is clearly selected. So it's seems like the URL might be sanitize at some point before Bruno make the request but the method is not correct. I'm not sure why.