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

RTSP headers #9182

Closed
a-blekot opened this issue Jul 12, 2021 · 2 comments
Closed

RTSP headers #9182

a-blekot opened this issue Jul 12, 2021 · 2 comments

Comments

@a-blekot
Copy link

Hi everyone)

I'm not sure if it should be fixed but with some of our IP cameras, we had a problem with Authorization, because of lowerCase headers.

final class RtspHeaders {
   public static final String ACCEPT = "accept";
   public static final String ALLOW = "allow";
   ...

I have reverted changes to normal case (Accept, ...) and now it works correctly.
Also, I have changed this code in RtspHeaders:

public Builder add(String headerName, String headerValue) {
      // namesAndValuesBuilder.put(Ascii.toLowerCase(headerName.trim()), headerValue.trim());
      namesAndValuesBuilder.put(headerName.trim(), headerValue.trim());
      return this;
    }

public ImmutableList<String> values(String headerName) {
    //return namesAndValues.get(Ascii.toLowerCase(headerName));
    return namesAndValues.get(headerName);
  }

If it makes sense you can add these changes to repo))

@claincly
Copy link
Contributor

It could be the specifics of your IP camera, could you elaborate?

As an aside, the header names are handled case insensitively, as mandated by RFC2068 (section 4.2):

Field names are case-insensitive.

@a-blekot
Copy link
Author

Hm... ok. I will ask our support team what is the difference between our cameras.
Thank you for the reference!

kim-vde pushed a commit that referenced this issue Jul 23, 2021
Using all lower case RTSP headers is perfectly valid, as the spec mandates case
insensitively. However, some RTSP servers do not implement the RTSP spec
closely and does not recognize the lower case headers. This change aims
at using the header names as defined in the RTSP spec to maximize compatibility.

Issue: #9182
PiperOrigin-RevId: 386224566
@google google locked and limited conversation to collaborators Sep 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants