Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use forked reqwest for manual redirect policy in worker #56

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 49 additions & 4 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ default = ["console_error_panic_hook"]
[dependencies]
linkup = { path = "../linkup", features = ["worker", "reqwest"]}
worker = "0.0.18"
reqwest = "0.11.22"
reqwest = { git = "https://github.com/ostenbom/reqwest.git", branch = "add-wasm-redirect" }
# reqwest = { path = "../../reqwest" }
# reqwest = "0.11.22"
ostenbom marked this conversation as resolved.
Show resolved Hide resolved
http = "0.2.9"
regex = "1.8.1"
cfg-if = "1.0.0"
Expand Down
6 changes: 5 additions & 1 deletion worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ async fn linkup_request_handler<'a, S: StringStore>(
};

// // Proxy the request using the destination_url and the merged headers
let client = reqwest::Client::new();
let client = reqwest::Client::builder()
.redirect(reqwest::redirect::Policy::none())
.build()
.unwrap();

headers.extend(&extra_headers);
let response_result = client
.request(method, &target_service.url)
Expand Down