usebruno / bruno

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

Curl import changes URL #2379

Open allanf181 opened 2 weeks ago

allanf181 commented 2 weeks ago

I have checked the following:

Describe the bug

When a curl command is imported, the url is changed by removing the last / curl 'http://example.com/test/' turns into http://example.com/test

This affects endpoints that end with /

.bru file to reproduce the bug

No response

Screenshots/Live demo link

https://github.com/usebruno/bruno/assets/14101716/8c417d75-78f6-49ac-a008-737a63840656

satokenta940 commented 2 weeks ago

When you import cURL from Apidog, you won't encounter this issue. Give it a try; I think it's quite effective.

jokj624 commented 20 hours ago

https://github.com/usebruno/bruno/blob/b01f2e0c5fe7cf6c0d4b3d111033f71f9d8be56b/packages/bruno-app/src/utils/curl/curl-to-json.js#L126

Maybe it's removed by this line. However, is there a case where it only works when there is a '/' at the end of the url?

jwetzell commented 1 hour ago

@jokj624 that line is actually specifically written to remove the / from the end of a url. So seems like they are intentionally stripping of that last backslash for some reason. Not sure why the raw_url field also gets the processed value. That does not seem "raw" to me.