Skip to content

Commit

Permalink
fix: apply baseURL
Browse files Browse the repository at this point in the history
  • Loading branch information
orionmiz committed Aug 9, 2023
1 parent a4f9e83 commit f878c74
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/plantae/src/axios/createAxiosInterceptors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ import type { AdapterRequest, AdapterResponse, CreateAdapter } from "../types";
function convertToAdapterRequest(
req: InternalAxiosRequestConfig
): AdapterRequest {
return new Request(req.url ?? "", {
body: new Request(req.url ?? "", { body: req.data }).body,
const url = new URL(req.url ?? "", req.baseURL);

return new Request(url, {
body: new Request(url, { body: req.data }).body,
method: req.method ?? "GET",
headers: new Headers(req.headers.toJSON(true) as HeadersInit),
signal: req.signal as AbortSignal,
Expand Down

0 comments on commit f878c74

Please sign in to comment.