Skip to content

Commit

Permalink
fix: support relative urls
Browse files Browse the repository at this point in the history
  • Loading branch information
jackmellis committed Jul 18, 2024
1 parent 57da9dd commit 520d794
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/query/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ const query = async <T>(args: Args): Promise<T> => {

while (urls.length) {
try {
const url = urls.shift();
let url = urls.shift();
if (!url) {
continue;
}
if (url.startsWith('/') && typeof window !== 'undefined') {
url = `${window.location.origin}${url}`;
}
const uri = new URL(url);

if (method === 'GET') {
Expand Down

0 comments on commit 520d794

Please sign in to comment.