You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Anton Tanasenko (JIRA)" <ji...@apache.org> on 2009/04/29 08:55:30 UTC

[jira] Created: (ASYNCWEB-27) Form processing

Form processing
---------------

                 Key: ASYNCWEB-27
                 URL: https://issues.apache.org/jira/browse/ASYNCWEB-27
             Project: Asyncweb
          Issue Type: Bug
            Reporter: Anton Tanasenko
            Priority: Minor


Version: latest trunk

DefaultHttpRequest.setContent(IoBuffer) fails to read x-www-form-urlencoded data if content type header also contains charset.
Example: Content-type: application/x-www-form-urlencoded; charset=utf-8.
Fix proposal:

Index: common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java
===================================================================
--- common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java	(revision 768267)
+++ common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java	(working copy)
@@ -280,8 +281,13 @@
             throw new NullPointerException("content");
         }
         
-        if (HttpHeaderConstants.VALUE_URLENCODED_FORM.equalsIgnoreCase(
-                getContentType())) {
+        String ct = getContentType();
+        if(ct != null && ct.toLowerCase().startsWith(HttpHeaderConstants.VALUE_URLENCODED_FORM.toLowerCase())){
+
             content.mark();
             try {
                 setParameters(content.getString(


Also, form POST parameters cause GET parameters to be cleared. Is that intentional? I didn't find anything that states get and post should be mutually exclusive.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (ASYNCWEB-27) Form processing

Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ASYNCWEB-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Vermillard reassigned ASYNCWEB-27:
-----------------------------------------

    Assignee: Julien Vermillard

> Form processing
> ---------------
>
>                 Key: ASYNCWEB-27
>                 URL: https://issues.apache.org/jira/browse/ASYNCWEB-27
>             Project: Asyncweb
>          Issue Type: Bug
>            Reporter: Anton Tanasenko
>            Assignee: Julien Vermillard
>            Priority: Minor
>
> Version: latest trunk
> DefaultHttpRequest.setContent(IoBuffer) fails to read x-www-form-urlencoded data if content type header also contains charset.
> Example: Content-type: application/x-www-form-urlencoded; charset=utf-8.
> Fix proposal:
> Index: common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java
> ===================================================================
> --- common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java	(revision 768267)
> +++ common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java	(working copy)
> @@ -280,8 +281,13 @@
>              throw new NullPointerException("content");
>          }
>          
> -        if (HttpHeaderConstants.VALUE_URLENCODED_FORM.equalsIgnoreCase(
> -                getContentType())) {
> +        String ct = getContentType();
> +        if(ct != null && ct.toLowerCase().startsWith(HttpHeaderConstants.VALUE_URLENCODED_FORM.toLowerCase())){
> +
>              content.mark();
>              try {
>                  setParameters(content.getString(
> Also, form POST parameters cause GET parameters to be cleared. Is that intentional? I didn't find anything that states get and post should be mutually exclusive.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ASYNCWEB-27) Form processing

Posted by "Julien Vermillard (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ASYNCWEB-27?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Vermillard resolved ASYNCWEB-27.
---------------------------------------

    Resolution: Fixed

thanks, applied the patch

> Form processing
> ---------------
>
>                 Key: ASYNCWEB-27
>                 URL: https://issues.apache.org/jira/browse/ASYNCWEB-27
>             Project: Asyncweb
>          Issue Type: Bug
>            Reporter: Anton Tanasenko
>            Assignee: Julien Vermillard
>            Priority: Minor
>
> Version: latest trunk
> DefaultHttpRequest.setContent(IoBuffer) fails to read x-www-form-urlencoded data if content type header also contains charset.
> Example: Content-type: application/x-www-form-urlencoded; charset=utf-8.
> Fix proposal:
> Index: common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java
> ===================================================================
> --- common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java	(revision 768267)
> +++ common/src/main/java/org/apache/asyncweb/common/DefaultHttpRequest.java	(working copy)
> @@ -280,8 +281,13 @@
>              throw new NullPointerException("content");
>          }
>          
> -        if (HttpHeaderConstants.VALUE_URLENCODED_FORM.equalsIgnoreCase(
> -                getContentType())) {
> +        String ct = getContentType();
> +        if(ct != null && ct.toLowerCase().startsWith(HttpHeaderConstants.VALUE_URLENCODED_FORM.toLowerCase())){
> +
>              content.mark();
>              try {
>                  setParameters(content.getString(
> Also, form POST parameters cause GET parameters to be cleared. Is that intentional? I didn't find anything that states get and post should be mutually exclusive.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.