-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix for error with params #2448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add more details on how this fix works?
Consider those calls https://spring-boot-test-aplication.herokuapp.com/api/users/findById/:id (set 16 as :id) The difference between them are the "params" tag in the request. Request with params :id : mode: 'none', Request without param : mode: 'none', As you can see the difference lays in the params property. Since it is already decoded (the request.url is - at this point - already filled with the correct param) we don't need it anymore. And putting it, axios refuse the request because of an exception related to the actual url composed : _header: 'GET /api/users/findById/16?0[name]=id&0[value]=16&0[enabled]=true&0[type]=path&0[uid]=w4AGcAZKgr0VVwXrnBKt7 HTTP/1.1\r\n' + So, removing the params property, works fine. Maybe is not the cleaner solution, but I can give the idea of what's happening. Regards |
Adding test files (related to the issue) |
@@ -499,6 +499,8 @@ const registerNetworkIpc = (mainWindow) => { | |||
let response, responseTime; | |||
try { | |||
/** @type {import('axios').AxiosResponse} */ | |||
// Looks like the "params" create problems if filled | |||
request.params = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After interpolation, we can remove the params values as they are already interpolated in the URL, making the approach simpler.
delete request.params;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sanjai0py Thanks a lot for the hint (I'm still working on my knowledge of Bruno), I've just updated my PR. Let me know if it's ok, hope to be (somehow) helpful
Thanks @fgrande for investigating the issue and coming up with the fix. I feel the code related to deleting the path params is better to be kept inside the Closing this PR. Thanks again for your work on this. |
Description
This would fix Issue #2439
Looks like "params" property breaks the call, and this is filled with the params.