Append tailing slash "/" to domain name if omitted when initializing the Reflect class #3

Closed
opened 2023-11-09 11:30:42 +01:00 by Ghost · 0 comments
Ghost commented 2023-11-09 11:30:42 +01:00 (Migrated from codeberg.org)

If the Reflect class is initialized without a tailing slash for the domain name, any request made with call() will just concat the pathname onto the domain name

const test = new API("https://example.com");
console.log(await test.call("my/endpoint")); // Requests: https://example.commy/endpoint
If the Reflect class is initialized without a tailing slash for the domain name, any request made with `call()` will just concat the pathname onto the domain name ```js const test = new API("https://example.com"); console.log(await test.call("my/endpoint")); // Requests: https://example.commy/endpoint ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
reflect/client-js#3
No description provided.