Skip to content

Case-insensitive matching of authentication scheme? #1339

@euantorano

Description

@euantorano

I'm trying to register to a SIP proxy that sends the WWW-Authenticate header back to a register request in the form:

DIGEST realm="...",qop="auth",nonce="BroadWorksXm7j92sh3Tj3jwpbBW",algorithm=MD5

Note here that the authentication scheme is set to DIGEST rather than Digest.

I managed to get things working with a single line change to Line 859 of SIPHeader.cs to use StringComparison.OrdinalIgnoreCase:

- if (headerValue.StartsWith(SIPAuthorisationDigest.METHOD))
+ if (headerValue.StartsWith(SIPAuthorisationDigest.METHOD, StringComparison.OrdinalIgnoreCase))

I've verified this works locally, but wanted to check before opening a PR whether this would have any chance of being accepted since the RFCs all specify the scheme should be spelled as Digest.

There are various sources on the web that state the authentication scheme is supposed to be case-insensitive when related to HTTP, but I can't find much when related to SIP. The only reference I could find is from 20 years ago, but here are a few related to HTTP:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions