axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ias" <iasan...@tmax.co.kr>
Subject RE: cvs commit: ws-axis/java/src/org/apache/axis/transport/http HTTPSender.java
Date Tue, 18 May 2004 06:55:38 GMT
FYI,

I'd like to mention that this change is also related to AXIS-1359 Duplicate
HTTP headers at http://issues.apache.org/jira/browse/AXIS-1359 . According
to ftp://ftp.isi.edu/in-notes/rfc2616.txt

4.2
Multiple message-header fields with the same field-name MAY be
   present in a message if and only if the entire field-value for that
   header field is defined as a comma-separated list [i.e., #(values)].
   It MUST be possible to combine the multiple header fields into one
   "field-name: field-value" pair, without changing the semantics of the
   message, by appending each subsequent field-value to the first, each
   separated by a comma. The order in which header fields with the same
   field-name are received is therefore significant to the
   interpretation of the combined field value, and thus a proxy MUST NOT
   change the order of these field values when a message is forwarded.

Therefore, I think 

HEADER_USER_AGENT
HEADER_HOST
HEADER_CACHE_CONTROL
HEADER_PRAGMA
HEADER_SOAP_ACTION

should follow the way HEADER_CONTENT_TYPE is handled. Or, more generally,
making header pool in the beginning of writeToSocket method and removing
any illegal duplicate headers without holes would be better.

Your comments and opinions are always welcome,

Ias
 

> -----Original Message-----
> From: ias@apache.org [mailto:ias@apache.org] 
> Sent: Tuesday, May 18, 2004 3:47 PM
> To: ws-axis-cvs@apache.org
> Subject: cvs commit: 
> ws-axis/java/src/org/apache/axis/transport/http HTTPSender.java
> 
> ias         2004/05/17 23:47:17
> 
>   Modified:    java/src/org/apache/axis/transport/http HTTPSender.java
>   Log:
>   Resolve conflicts between HTTP content type header from 
> Axis and SAAJ. Respect users' setting first according to SAAJ 
> API's intention.
>   This improvement also avoid duplicate content type headers as well.
>   
>   Revision  Changes    Path
>   1.117     +13 -2     
> ws-axis/java/src/org/apache/axis/transport/http/HTTPSender.java
>   
>   Index: HTTPSender.java
>   ===================================================================
>   RCS file: 
> /home/cvs/ws-axis/java/src/org/apache/axis/transport/http/HTTP
> Sender.java,v
>   retrieving revision 1.116
>   retrieving revision 1.117
>   diff -u -r1.116 -r1.117
>   --- HTTPSender.java	17 May 2004 14:08:05 -0000	1.116
>   +++ HTTPSender.java	18 May 2004 06:47:17 -0000	1.117
>   @@ -283,12 +283,21 @@
>            header2.append(http10 ? HTTPConstants.HEADER_PROTOCOL_10 :
>                    HTTPConstants.HEADER_PROTOCOL_11)
>                    .append("\r\n");
>   +        MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
>   +
>            if (posting) {
>   +        	String contentType;
>   +            if 
> (mimeHeaders.getHeader(HTTPConstants.HEADER_CONTENT_TYPE) != null) {
>   +            	contentType = 
> mimeHeaders.getHeader(HTTPConstants.HEADER_CONTENT_TYPE)[0];
>   +            } else {
>   +            	contentType = 
> reqMessage.getContentType(msgContext.getSOAPConstants());
>   +            }
>                header2.append(HTTPConstants.HEADER_CONTENT_TYPE)
>                        .append(": ")
>   -                    
> .append(reqMessage.getContentType(msgContext.getSOAPConstants()))
>   +                    .append(contentType)
>                        .append("\r\n");
>            }
>   +
>            header2.append( HTTPConstants.HEADER_ACCEPT ) 
> //Limit to the types that are meaningful to us.
>                    .append( ": ")
>                    .append( HTTPConstants.HEADER_ACCEPT_APPL_SOAP)
>   @@ -338,10 +347,12 @@
>            }
>    
>            // Transfer MIME headers of SOAPMessage to HTTP headers. 
>   -        MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
>            if (mimeHeaders != null) {
>                for (Iterator i = mimeHeaders.getAllHeaders(); 
> i.hasNext(); ) {
>                    MimeHeader mimeHeader = (MimeHeader) i.next();
>   +                if 
> (mimeHeader.getName().equals(HTTPConstants.HEADER_CONTENT_TYPE)) {
>   +                	continue;
>   +                }
>                    header2.append(mimeHeader.getName())
>                    .append(": ")
>                    .append(mimeHeader.getValue())
>   
>   
>   
> 


Mime
View raw message