We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8368817 commit 9774203Copy full SHA for 9774203
‎src/index.ts
@@ -213,7 +213,11 @@ function request<P extends Payload>(
213
): ResponsePromise<P> {
214
const options: RequestOptions<P> = mergeOptions(DEFAULTS, baseOptions)
215
const promise = new Promise<Response<P>>((resolve, reject) => {
216
- const url = new URL(options.resource)
+ const url = new URL(
217
+ options.resource,
218
+ typeof location === 'undefined' ? undefined : location.origin
219
+ )
220
+
221
url.search += options.params
222
223
if (options.json != null) {
0 commit comments