Skip to content

Commit ba6d044

Browse files
Incorporate PR feedback
1 parent d2644e2 commit ba6d044

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/client.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ export class HttpClient {
113113
logDebug(`isDeepL: ${isDeepL}`);
114114

115115
const axiosRequestConfig: AxiosRequestConfig = {
116-
url: isDeepL ? url : undefined,
116+
url,
117117
method,
118-
baseURL: isDeepL ? this.serverUrl : url,
118+
baseURL: isDeepL ? this.serverUrl : undefined,
119119
headers,
120120
responseType: responseAsStream ? 'stream' : 'text',
121121
timeout: timeoutMs,
@@ -247,19 +247,10 @@ export class HttpClient {
247247
}
248248
}
249249

250-
let contentType: string | undefined = undefined;
251-
if (response.headers.getContentType) {
252-
if (typeof response.headers.getContentType === 'string') {
253-
contentType = response.headers.getContentType;
254-
} else {
255-
contentType = response.headers.getContentType()?.toString() ?? undefined;
256-
}
257-
}
258-
259250
return {
260251
statusCode: response.status,
261252
content: response.data,
262-
contentType: contentType,
253+
contentType: response.headers['content-type'],
263254
};
264255
} catch (axios_error_raw) {
265256
const axiosError = axios_error_raw as AxiosError;

0 commit comments

Comments
 (0)