kean / Get

Web API client built using async/await
MIT License
943 stars 75 forks source link

baseURL incorrect #45

Closed i-tengfei closed 2 years ago

i-tengfei commented 2 years ago
let baseURL = URL(string: "https://gitlab.com/api/v4")
URL(string: "/test", relativeTo: baseURL)?.absoluteString

expect https://gitlab.com/api/v4/test

result https://gitlab.com/test

2022-07-14 05 19 14

https://github.com/kean/Get/commit/73476a85cb69345886ac18e6d07c115bc6c9b00b

kean commented 2 years ago

Thanks for the report, @i-tengfei. I just switched to this API in the pre-release apparently fully without releasing how it worked. I'm going to revert the change. The baseURL should allow you to provide URLs with a path.

kean commented 2 years ago

Fixed in #46. I added your example as a unit test. After it's merged, please install from the main branch. There will be a new RC, but not immediately.