Skip to content

Replace curl redirector with redirect interceptor#240

Merged
sagebind merged 3 commits into
masterfrom
fix/redirect-interceptor
Oct 24, 2020
Merged

Replace curl redirector with redirect interceptor#240
sagebind merged 3 commits into
masterfrom
fix/redirect-interceptor

Conversation

@sagebind

@sagebind sagebind commented Oct 22, 2020

Copy link
Copy Markdown
Owner

Implement redirect following ourselves using an interceptor instead of using curl's redirect implementation. This ensures that redirect handling happens at a higher layer than other interceptors (such as the cookie interceptor) but also opens the door for custom redirect logic.

Fixes #232.

@codecov

codecov Bot commented Oct 22, 2020

Copy link
Copy Markdown

Codecov Report

Merging #240 into master will decrease coverage by 0.24%.
The diff coverage is 70.70%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #240      +/-   ##
==========================================
- Coverage   72.08%   71.83%   -0.25%     
==========================================
  Files          47       48       +1     
  Lines        2271     2397     +126     
==========================================
+ Hits         1637     1722      +85     
- Misses        634      675      +41     
Impacted Files Coverage Δ
src/config/dial.rs 67.30% <ø> (ø)
src/config/redirect.rs 100.00% <ø> (+28.57%) ⬆️
src/interceptor/mod.rs 0.00% <ø> (ø)
src/lib.rs 75.00% <ø> (ø)
src/request.rs 28.00% <22.22%> (-52.00%) ⬇️
src/redirect.rs 82.05% <82.05%> (ø)
src/client.rs 69.20% <89.74%> (+3.12%) ⬆️
src/handler.rs 71.37% <100.00%> (-0.83%) ⬇️
src/interceptor/context.rs 75.00% <100.00%> (ø)
tests/redirects.rs 98.78% <100.00%> (+0.50%) ⬆️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 97fd0b7...33c345c. Read the comment docs.

@sagebind sagebind marked this pull request as ready for review October 24, 2020 04:08
@sagebind sagebind merged commit eea81f6 into master Oct 24, 2020
@sagebind sagebind deleted the fix/redirect-interceptor branch October 24, 2020 04:10
sagebind added a commit that referenced this pull request Nov 11, 2020
Fix a regression from #240 that caused redirect policies to be ignored if being set client-wide instead of per-request.

Fixes #250.
sagebind added a commit that referenced this pull request Nov 11, 2020
Fix a regression from #240 that caused redirect policies to be ignored if being set client-wide instead of per-request.

Fixes #250.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cookies aren't sent when following redirects

1 participant