Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Path parameters are added as URL search parameters (v1.19.0) #2528

Closed
2 tasks done
ThenTech opened this issue Jun 28, 2024 · 5 comments
Closed
2 tasks done

[Issue] Path parameters are added as URL search parameters (v1.19.0) #2528

ThenTech opened this issue Jun 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@ThenTech
Copy link

ThenTech commented Jun 28, 2024

I have checked the following:

  • I use the newest version of bruno.
  • I've searched existing issues and found nothing related to my issue.

Describe the bug

In v1.19.0, using the new path params feature introduced in #484, I'm getting an issue where Bruno is adding the req.params object as query parameter, e.g.:

URL (in UI): {{baseURL}}/some/route/:pk/
Path param: pk with value test

If I look in Timeline or console.log(req) in post response, the URL I see is:

http://127.0.0.1:8000/v1/app/some/route/test

Which should be correct, however, my API endpoint is being called with:

/v1/app/some/route/test/?0[name]=pk&0[value]=test&0[enabled]=true&0[type]=path&0[uid]=1gTYMy1cJaQsEkW93yRGP

It seems somewhere during the URL interpolation, the URL search params are updated with the data in req.params as shown above.

req = {
    ...
    params: [
        {
            "name": "pk",
            "value": "test",
            "enabled": true,
            "type": "path",
            "uid": "1gTYMy1cJaQsEkW93yRGP"
        }
    ],
    ...
}

Additionally, the trailing slash is also not kept any more.

Possibly related to #2506?

.bru file to reproduce the bug

meta {
  name: Test
  type: http
  seq: 5
}

get {
  url: {{baseURL}}/some/route/:pk/
  body: none
  auth: inherit
}

params:path {
  pk: test
}

script:pre-request {
  console.log("Pre:", req.url);
}

script:post-response {
  console.log("Post:", req.url);
}

Screenshots/Live demo link

image

@ThenTech ThenTech added the bug Something isn't working label Jun 28, 2024
@sanjai0py
Copy link
Member

Hey @ThenTech can you please share a minimal .bru or json export?

@ThenTech
Copy link
Author

Hey @ThenTech can you please share a minimal .bru or json export?

I edited the original post to add the .bru file of the request shown, though there's not much to see.

@Lixfeld
Copy link

Lixfeld commented Jul 5, 2024

@ThenTech I had the same issue in version 1.19.0 but in the current version (1.20.1) this seems to be fixed.

@ThenTech
Copy link
Author

ThenTech commented Jul 5, 2024

@ThenTech I had the same issue in version 1.19.0 but in the current version (1.20.1) this seems to be fixed.

Oh I'll check it again later then. And close the issue if it is indeed fixed.

@ThenTech
Copy link
Author

ThenTech commented Jul 6, 2024

@Lixfeld It is indeed fixed now. Thank for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants