You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by victorsosa <gi...@git.apache.org> on 2016/02/15 19:17:04 UTC

[GitHub] struts pull request: WW-4558 contentType override ignored for JSON...

Github user victorsosa commented on a diff in the pull request:

    https://github.com/apache/struts/pull/87#discussion_r52929566
  
    --- Diff: plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java ---
    @@ -70,17 +70,22 @@
         private boolean noCache = false;
         private boolean excludeNullProperties;
         private String callbackParameter;
    -    private String contentType;
    +    private String accept;
     
         @SuppressWarnings("unchecked")
         public String intercept(ActionInvocation invocation) throws Exception {
             HttpServletRequest request = ServletActionContext.getRequest();
             HttpServletResponse response = ServletActionContext.getResponse();
    -        String contentType = request.getHeader("content-type");
    -        if (contentType != null) {
    +        
    +        //parameter wasn't set by the interceptor
    +        if (accept == null) {
    +            accept = request.getHeader("accept");
    +        }
    +        
    +        if (accept != null) {
    --- End diff --
    
    This can be remove, it is not needed anymore, we are using accept parameter


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org