Skip to content

Commit

Permalink
simplify if
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Oct 9, 2024
1 parent 30e1ac9 commit 860ddb5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions plugins/http/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,8 @@ pub async fn fetch<R: Runtime>(
headers.append(header::USER_AGENT, HeaderValue::from_str(HTTP_USER_AGENT)?);
}

if cfg!(not(feature = "unsafe-headers"))
|| (cfg!(feature = "unsafe-headers") && !headers.contains_key(header::ORIGIN))
{
// ensure we have an Origin header set
if cfg!(not(feature = "unsafe-headers")) || !headers.contains_key(header::ORIGIN) {
if let Ok(url) = webview.url() {
headers.append(
header::ORIGIN,
Expand Down

0 comments on commit 860ddb5

Please sign in to comment.