You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request: Improve URL Construction to Handle Leading Slashes in path Option Gracefully
Description:
It is easy to mistakenly include a leading slash when specifying the path in request options, like so:
path: `/record/v1/customer/${id}`;
This causes an authentication error when attempting to fetch the result. The issue arises because the leading slash breaks the URL construction process.
Suggested Improvement:
A robust solution would ensure that the URL is constructed correctly regardless of whether the path is provided with or without a leading slash. This could prevent potential errors and improve developer experience.
Potential Implementation:
If there is a built-in Node.js function for constructing URLs that normalizes the path parameter, it might solve this issue seamlessly. For example, leveraging URL or other standard libraries to handle path concatenation could prevent errors like this.
This feature would improve the developer experience and reduce potential pitfalls for users of the library. I'm raising this feature request as a future enhancement and would be happy to contribute a fix at some point.
The text was updated successfully, but these errors were encountered:
Feature Request: Improve URL Construction to Handle Leading Slashes in
path
Option GracefullyDescription:
It is easy to mistakenly include a leading slash when specifying the
path
in request options, like so:This causes an authentication error when attempting to fetch the result. The issue arises because the leading slash breaks the URL construction process.
Suggested Improvement:
A robust solution would ensure that the URL is constructed correctly regardless of whether the
path
is provided with or without a leading slash. This could prevent potential errors and improve developer experience.Potential Implementation:
If there is a built-in Node.js function for constructing URLs that normalizes the
path
parameter, it might solve this issue seamlessly. For example, leveragingURL
or other standard libraries to handle path concatenation could prevent errors like this.Reference:
The relevant code section can be found here:
netsuite-api-client/src/client.ts
Line 75 in b328104
Rationale:
This feature would improve the developer experience and reduce potential pitfalls for users of the library. I'm raising this feature request as a future enhancement and would be happy to contribute a fix at some point.
The text was updated successfully, but these errors were encountered: