Closed kaeedo closed 7 years ago
Preserving path is now the default, and cannot be turned off. the version in package.json
has been bumped to 0.15.0. Unit test for trailing slashes and no slashes are also there
please resolve conflicts (bump version to 0.16) and I'll review tomorrow.
not a problem - if you do something illogical like putting a drive letter in an url path it won't work. We're optimizing for the positive case scenarios (rooted and unrooted relative paths)
Sent from Outlookhttp://aka.ms/weboutlook
From: Kai notifications@github.com Sent: Friday, December 1, 2017 10:14:33 AM To: Microsoft/typed-rest-client Cc: Bryan MacFarlane; Comment Subject: Re: [Microsoft/typed-rest-client] Support path in the base url (#23)
@kaeedo commented on this pull request.
- combined.pathname = path.join(base.pathname, combined.pathname);
The problem with using path.resolve on a Windows system, is that an absolute path will include a drive letter. For the test case
let res: string = util.getUrl('get/foo', 'http://httpbin.org/bar'); res comes out to http://httpbin.org/C:\bar\get\foo
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Ftyped-rest-client%2Fpull%2F23%23discussion_r154368542&data=02%7C01%7Cbryanmac%40microsoft.com%7C568f6fb651ef4b28f08408d538ce3a4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636477380748909514&sdata=lG6dyFfuGvbKdo9pF%2Fmgys9ElS4sksSfIC4MMm1El0g%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAA4IDANxuhddyh4Bu-ABISySkyNDqQJGks5s8BfYgaJpZM4Qluss&data=02%7C01%7Cbryanmac%40microsoft.com%7C568f6fb651ef4b28f08408d538ce3a4f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636477380748909514&sdata=wtOsaHdCUrKVXmuJLjxpshvREn6Mopy9IosKrTpwr1s%3D&reserved=0.
Thanks!
published as typed-rest-client@preview
Why is this not in Master? Just discovered that BaseUrl cannot be a relative path. Worked fine for development, but now that I want to take my project online, I want to redirect all my API Calls to /api.
This PR adds the option to include an option to preserve the pathname specified in the base URL for the Rest Client. Default is false (maintains old behavior)