Skip to content

Commit

Permalink
Fix header init
Browse files Browse the repository at this point in the history
  • Loading branch information
theolampert committed Apr 8, 2024
1 parent e7d2306 commit 9c519ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/ECMASwift/API/Fetch/Fetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class FetchAPI {
FetchAPI.text(data: data, context: context)
}
return [
"url": response.url?.absoluteString,
"url": response.url?.absoluteString as Any,
"ok": response.statusCode >= 200 && response.statusCode < 400,
"status": response.statusCode,
"json": JSValue(object: jsonjs, in: context) as Any,
Expand Down
2 changes: 1 addition & 1 deletion Sources/ECMASwift/API/Headers/Headers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ final class Headers: NSObject, HeadersExports {
struct HeadersAPI {
func registerAPIInto(context: JSContext) {
let headersClass: @convention(block) (JSValue?) -> Headers = { headers in
if let headers {
if let headers, headers.hasValue {
Headers(withHeaders: headers.toDictionary() as! [String: String])
} else {
Headers()
Expand Down

0 comments on commit 9c519ae

Please sign in to comment.