Skip to content

Commit

Permalink
fix: Header -> Map
Browse files Browse the repository at this point in the history
  • Loading branch information
Ossianaa committed Aug 9, 2024
1 parent 823f32c commit 134102c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libcurl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class LibCurl {
if (!headers) {
return;
}
if (headers instanceof Headers) {
if (headers instanceof Map) {
headers.forEach((value, key) => this.setRequestHeader(key, value));
} else if (typeof headers == "string") {
headers
Expand Down
2 changes: 1 addition & 1 deletion src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class requests {
);
}
curl.open(method, url_);
if (!this.defaultRequestsHeaders.keys().next().done) {
if (this.defaultRequestsHeaders.size) {
curl.setRequestHeaders(this.defaultRequestsHeaders);
}
if (headers) {
Expand Down

0 comments on commit 134102c

Please sign in to comment.