You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by bu...@apache.org on 2010/12/01 16:51:10 UTC

DO NOT REPLY [Bug 50392] New: value is trimmed when sending the request in Multipart

https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

           Summary: value is trimmed when sending the request in Multipart
           Product: JMeter
           Version: 2.4
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: HTTP
        AssignedTo: notifications@jakarta.apache.org
        ReportedBy: kvelusamy@vitechinc.com


When user agent submit a request which is POST/Multipart to Jmeter Http Proxy
server, for the key and value arguments,value filed is being trimmed which is
totally wrong. what if the value field is depend on the space?

i figured out where is the problem and its in
org.apache.jmeter.protocol.http.config.MultipartUrlConfig 

i added the below code in parseArquments method and removed the trim part

/*
                     * Bug Fix
                     * Do not trim the value,just remove the extra char's
appended with value in the process.
                     * value always contains \n\r\n<value>\r\n 
                     */
                    if(value!=null)
                    {
                       
if(value.length()>=3&&value.substring(0,3).equals("\n\r\n"))
                        {
                            value=value.substring(3);
                        }                        
                       
if(value.length()>=2&&value.substring(value.length()-2).equals("\r\n"))
                        {
                            value=value.substring(0,value.length()-2);
                        }
                    }   

Please let me know if you need any more info.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50392] value is trimmed when sending the request in Multipart

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

--- Comment #1 from Sebb <se...@apache.org> 2010-12-02 09:37:03 EST ---
Thanks! 

I agree, there is a problem with the parsing of values - it should only strip
the initial blank line and the trailing EOL.

BTW, I'm not quite sure why the code allows for "\n\n" (LFLF); AFAIK, CRLF is
the only permitted EOL marker. However I think that option should be kept for
now.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50392] value is trimmed when sending the request in Multipart

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #2 from Sebb <se...@apache.org> 2010-12-02 09:46:48 EST ---
I've just tried to generate form data with trailing spaces in browsers, but IE,
FF and Opera all convert trailing spaces to +.

So what user agent caused the problem for you?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50392] value is trimmed when sending the request in Multipart

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #4 from Sebb <se...@apache.org> 2010-12-02 10:12:09 EST ---
Thanks! 
I'd not specified the enctype. 
Adding  enctype="multipart/form-data" now works with FF.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50392] value is trimmed when sending the request in Multipart

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

--- Comment #6 from Kanagamahendran Velusamy <kv...@vitechinc.com> 2010-12-02 10:36:24 EST ---
Thank you .You are Amazing!.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50392] value is trimmed when sending the request in Multipart

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

--- Comment #3 from Kanagamahendran Velusamy <kv...@vitechinc.com> 2010-12-02 09:51:44 EST ---
Keep the form as multipart so that it will be sent as it is
I used FF.
(In reply to comment #2)
> I've just tried to generate form data with trailing spaces in browsers, but IE,
> FF and Opera all convert trailing spaces to +.
> 
> So what user agent caused the problem for you?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org


DO NOT REPLY [Bug 50392] value is trimmed when sending the request in Multipart

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50392

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Sebb <se...@apache.org> 2010-12-02 10:26:03 EST ---
Fixed in SVN:

URL: http://svn.apache.org/viewvc?rev=1041406&view=rev
Log:
Bug 50392 - value is trimmed when sending the request in Multipart

Modified:
  
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/config/MultipartUrlConfig.java
  
jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/config/MultipartUrlConfigTest.java
   jakarta/jmeter/trunk/xdocs/changes.xml

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@jakarta.apache.org
For additional commands, e-mail: notifications-help@jakarta.apache.org