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 13:30:02 UTC

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

GitHub user victorsosa opened a pull request:

    https://github.com/apache/struts/pull/87

    Ww 4558 contentType override ignored for JSONInterceptor

    From now on:
    
    The "accept" request header parameter must be "application/json" or "application/json-rpc"
    
    Also the default encoding is "UTF-8"

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/victorsosa/struts ww-4558

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/87.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #87
    
----
commit e05f9f01804bc64ace15bfc573ef483da583e5a7
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-01-21T12:00:54Z

    Merge pull request #3 from apache/master
    
    update pull

commit 778eec3b94f283290f186c8caffd10f03576fa27
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-01-26T12:38:50Z

    Merge pull request #4 from apache/master
    
    update pull

commit 46bd92fe202041c76704b96d11a0b8f8e83d56de
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-01-29T21:54:27Z

    Merge pull request #5 from apache/master
    
    update pull

commit a2c5bc835ec06483af6175fc0abf67714fb28711
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-02-04T17:12:22Z

    Merge pull request #6 from apache/master
    
    pull update

commit fab687a07e8d873c82465b29188100debf61097f
Author: victorsosa <vi...@peopleware.do>
Date:   2016-02-15T12:28:01Z

    fix patch WW-4558
    
    contentType override ignored for JSONInterceptor
    
    From now on:
    
    The "accept" request header parameter must be "application/json" or
    "application/json-rpc"
    
    Also the default encoding is "UTF-8"

----


---
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


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

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/struts/pull/87


---
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


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

Posted by ke4qqq <gi...@git.apache.org>.
Github user ke4qqq commented on the pull request:

    https://github.com/apache/struts/pull/87#issuecomment-201363711
  
    Closing to test travis integration - reopen shortly. 


---
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


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

Posted by victorsosa <gi...@git.apache.org>.
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


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

Posted by ke4qqq <gi...@git.apache.org>.
Github user ke4qqq closed the pull request at:

    https://github.com/apache/struts/pull/87


---
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


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

Posted by victorsosa <gi...@git.apache.org>.
GitHub user victorsosa reopened a pull request:

    https://github.com/apache/struts/pull/87

    WW-4558 contentType override ignored for JSONInterceptor

    From now on:
    
    The "accept" request header parameter must be "application/json" or "application/json-rpc"
    
    Also the default encoding is "UTF-8"

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/victorsosa/struts ww-4558

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/struts/pull/87.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #87
    
----
commit e05f9f01804bc64ace15bfc573ef483da583e5a7
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-01-21T12:00:54Z

    Merge pull request #3 from apache/master
    
    update pull

commit 778eec3b94f283290f186c8caffd10f03576fa27
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-01-26T12:38:50Z

    Merge pull request #4 from apache/master
    
    update pull

commit 46bd92fe202041c76704b96d11a0b8f8e83d56de
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-01-29T21:54:27Z

    Merge pull request #5 from apache/master
    
    update pull

commit a2c5bc835ec06483af6175fc0abf67714fb28711
Author: victor sosa <vi...@users.noreply.github.com>
Date:   2016-02-04T17:12:22Z

    Merge pull request #6 from apache/master
    
    pull update

commit fab687a07e8d873c82465b29188100debf61097f
Author: victorsosa <vi...@peopleware.do>
Date:   2016-02-15T12:28:01Z

    fix patch WW-4558
    
    contentType override ignored for JSONInterceptor
    
    From now on:
    
    The "accept" request header parameter must be "application/json" or
    "application/json-rpc"
    
    Also the default encoding is "UTF-8"

commit 0d4905038119f614f021af5738154079b30bca24
Author: victorsosa <vi...@peopleware.do>
Date:   2016-02-15T12:28:01Z

    fix patch WW-4558
    
    contentType override ignored for JSONInterceptor
    
    use of accept parameter st by the interceptor params
    
    
    Signed-off-by: victorsosa <vi...@peopleware.do>

commit bab451c6d80ee9b2685570d797e505768ff8bbe4
Author: victorsosa <vi...@peopleware.do>
Date:   2016-02-15T14:34:15Z

    Merge branch 'ww-4558' of github.com:victorsosa/struts into ww-4558
    
    # Conflicts:
    #	plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java

commit 2fada1ec05e61dfb0b3e43ab447a7673d689c684
Author: victorsosa <vi...@peopleware.do>
Date:   2016-02-15T14:34:15Z

    Merge branch 'ww-4558' of github.com:victorsosa/struts into ww-4558
    
    # Conflicts:
    #	plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java

commit 8b8135af79550bf732d5aaa98ee7d3d5116e4b4b
Author: victorsosa <vi...@peopleware.do>
Date:   2016-02-15T14:37:26Z

    Merge branch 'ww-4558' of github.com:victorsosa/struts into ww-4558
    
    # Conflicts:
    #	plugins/json/src/main/java/org/apache/struts2/json/JSONInterceptor.java

----


---
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