re: WWW-Authenticate header API : get/setURI
Peter Nick <[email protected]> Sat, 1 Sep 2007 02:46:39 +0800 (CST)
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <[email protected]> |
Hi, Excellent work !!! it was a big puzzle to me. Deprecation might be a good extension. BR niepin Jeroen van Bemmel <[email protected]> 写道: All, Ran into a minor issue today that I thought I might share here, at least to document it The WWWAuthenticateHeader and its derived class ProxyAuthenticateHeader have methods 'URI getURI' and 'setURI(URI)' for the "uri" parameter, which typically gets set to the request URI. However, today I encountered a client that used a value like "string" for this parameter, not a valid URI. I checked with RFC3261, which defers to RFC2616 (HTTP 1.1) which in turn points to RFC2396 (general URI syntax) RFC2616 section 5.1.2 defines Request-URI as: Request-URI = "*" | absoluteURI | abs_path | authority RFC2396 defines authority as: authority = server | reg_name reg_name = 1*( unreserved | escaped | "$" | "," | ";" | ":" | "@" | "&" | "=" | "+" ) so, strictly speaking, "string" is indeed a valid value for the "uri" parameter. getURI() throws a ParseException when the value does not contain a valid scheme part (i.e. "scheme:something"). In order to fix this, in a future version of the API, getURI/setURI should be defined as using a String for parameter. Perhaps we should create new methods e.g. "getURIString" and "setURIString", and deprecate the existing ones. Regards, Jeroen _______________________________________________ nist-sip mailing list [email protected] http://www-x.antd.nist.gov/mailman/listinfo/nist-sip --------------------------------- 雅虎免费邮箱,全球第一邮箱品牌! _______________________________________________ nist-sip mailing list [email protected] http://www-x.antd.nist.gov/mailman/listinfo/nist-sip