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

Add option to follow 301 and 302 redirection #93

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yujincheng08
Copy link
Contributor

Fix #92

src/client/mod.rs Outdated Show resolved Hide resolved
@yujincheng08
Copy link
Contributor Author

Hi, RTSP follows HTTP which also sends Authorization header to redirected target.

@yujincheng08
Copy link
Contributor Author

Change the option to max_redirect: u8 so that we can specify the maximum follows.

@yujincheng08
Copy link
Contributor Author

@scottlamb Gentle ping

2 similar comments
@yujincheng08
Copy link
Contributor Author

@scottlamb Gentle ping

@yujincheng08
Copy link
Contributor Author

@scottlamb Gentle ping

@scottlamb
Copy link
Owner

Hey, I know you've been waiting a long time on this. I'm uncomfortable though about the security implications of sending the credentials to another host.

Hi, RTSP follows HTTP which also sends Authorization header to redirected target.

Can you point me at where the spec mandates clients behave in that way? I can't find it, and I've read through the HTTP/1.1 spec (and specifically several versions of Authorization-related RFCs while writing http-auth) a fair bit.

Here's a stackoverflow thread on the subject, fwiw, and it suggests other clients have made the choice to remove credentials on redirect.

In your use case, are redirects happening to a different (scheme, host, port)? or is only the path changing?

I'd be less concerned about...

  1. keeping the credentials only if the (scheme, host, port) remain constant, or
  2. providing a "credential store" that can be queried on individual request, something like:
trait CredentialStore {
    fn get_credentials(url: &Url) -> Box<Future<Item = Result<Credentials, BoxError>>>
}

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.

Support redirection (status code = 301, 302)
2 participants