Skip to content

Commit

Permalink
fix(macos): fix malformed headers in custom protocol response (#1392)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrox authored Oct 15, 2024
1 parent 1064635 commit 1189e2a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-malformed-headers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wry": "patch"
---

Fix malformed headers in custom protocol response on macOS.
8 changes: 4 additions & 4 deletions src/wkwebview/class/url_scheme_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ extern "C" fn start_task(

if let Some(mime) = wanted_mime {
headers.insert_id(
NSString::from_str(mime.to_str().unwrap()).as_ref(),
NSString::from_str(CONTENT_TYPE.as_str()),
NSString::from_str(CONTENT_TYPE.as_str()).as_ref(),
NSString::from_str(mime.to_str().unwrap()),
);
}
headers.insert_id(
NSString::from_str(&content.len().to_string()).as_ref(),
NSString::from_str(CONTENT_LENGTH.as_str()),
NSString::from_str(CONTENT_LENGTH.as_str()).as_ref(),
NSString::from_str(&content.len().to_string()),
);

// add headers
Expand Down

0 comments on commit 1189e2a

Please sign in to comment.