cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@gmail.com>
Subject Re: svn commit: r1057390 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
Date Tue, 11 Jan 2011 16:50:00 GMT
Does it make sense to have a CONTENT_TYPE key but no value for it -- any 
legitimate use case?  Otherwise it may be better (if possible) to throw 
some runtime exception to alert the developer of the client or web 
service provider that he or she is erroneously adding the CONTENT_TYPE 
key but not giving it a value.

Glen

On 10.01.2011 17:02, dkulp@apache.org wrote:
> Author: dkulp
> Date: Mon Jan 10 22:02:25 2011
> New Revision: 1057390
>
> URL: http://svn.apache.org/viewvc?rev=1057390&view=rev
> Log:
> [CXF-3232] Add a NPE guard around setting the content type
>
> Modified:
>      cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
>
> Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
> URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java?rev=1057390&r1=1057389&r2=1057390&view=diff
> ==============================================================================
> --- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
(original)
> +++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
Mon Jan 10 22:02:25 2011
> @@ -362,7 +362,7 @@ public class Headers {
>       protected void copyToResponse(HttpServletResponse response) {
>           String contentType = getContentTypeFromMessage();
>
> -        if (!headers.containsKey(Message.CONTENT_TYPE)) {
> +        if (!headers.containsKey(Message.CONTENT_TYPE)&&  contentType != null)
{
>               response.setContentType(contentType);
>           }
>
>
>


Mime
View raw message