HTTP 基本用户身份验证:"Authorization" header 不接受 (case-sensitive)

HTTP basic user authentication : "Authorization" header not accepted (case-sensitive)

我正在使用 HTTP Header 基本身份验证将用户名和密码发送到服务器:

代码:

List<String> as = new ArrayList<String>();
HttpTransportProperties.Authenticator basicAuth = new HttpTransportProperties.Authenticator();

as.add(Authenticator.BASIC);
basicAuth.setAuthSchemes(as);

basicAuth.setUsername("ABC");
basicAuth.setPassword("password");

basicAuth.setPreemptiveAuthentication(true);

serviceStub._getServiceClient().getOptions().setProperty(
                org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
                basicAuthenticator);

我正在使用 Tomcat 6 作为服务器。

在 catalina.log 文件中,我可以看到以下内容:

header=authorization=Basic U2hyZXlhczpwYXNzd29yZA==

我希望 "authorization" 为 "Authorization",即 Captial 'A' 授权。

我已经检查了许多现有的 post 但找不到答案。

能否请您指教如何实现上述结果?

提前致谢

字段名,作为授权,不区分大小写

From RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", Section 4.2, "Message Headers":

Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive.

所以大小写无关紧要

编辑添加更新的HTTP/1.1 document 供参考