https://bz.apache.org/bugzilla/show_bug.cgi?id=65013
eR@SeR <nale...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW --- Comment #4 from eR@SeR <nale...@gmail.com> --- Hi, Quotes around parameter values are not generated anymore and if file extension is .png .jpg .jpeg .gif .avi (might be more) MIME type is properly recognized. However, some commonly used extensions like .bmp .pdf .doc .docx .xls .xlsx .rar .zip etc. are still not recognized and generated MIME type is still application/octet-stream. You can check "Common MIME types" list on https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types and add all mentioned MIME types. Besides this, I've found a few more findings that might be bugs: 1. If parameter starts with @ like "@somevalue", form-data parameter is put inside Files upload tab instead to remain in Parameters tab. 2. If same header or parameter name with same or different value is added, only last header or parameter is generated. All headers or parameters should be added even if they are duplicated. cURL example: curl --location --request POST 'http://example.com/api/somepath' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.2' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpeg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="@ID_CARD"' \ --form 'BacksideImage=@"/C:/Users/n.aleksic/Desktop/BTT flow .xlsx"' \ --form 'ApplicationTypeId="11"' DocumentType parameter moved to Files upload. Only one HTTP_X_FORWARDED_FOR header and ApplicationTypeId, BacksideImage parameters are imported. ----------------------------- And definitely the bug: 3. If URL, header or parameter value is blank, cURL is not imported. cURL example - URL: curl --location --request POST '' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"' Error: ERROR o.a.j.p.h.g.a.ParseCurlCommandAction: Error creating test plan from cURL command:curl --location --request POST '' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"', error:Unexpected format for command line:curl --location --request POST '' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"', error:Unknown option -h java.lang.IllegalArgumentException: Unexpected format for command line:curl --location --request POST '' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"', error:Unknown option -h at org.apache.jmeter.protocol.http.curl.BasicCurlParser.parse(BasicCurlParser.java:797) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.parseCommands(ParseCurlCommandAction.java:670) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.actionPerformed(ParseCurlCommandAction.java:619) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) ~[?:?] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) ~[?:?] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?] at java.awt.Component.processMouseEvent(Component.java:6636) ~[?:?] at javax.swing.JComponent.processMouseEvent(JComponent.java:3342) ~[?:?] at java.awt.Component.processEvent(Component.java:6401) ~[?:?] at java.awt.Container.processEvent(Container.java:2263) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:5012) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2321) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2307) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2762) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:743) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] ERROR o.a.j.p.h.g.a.ParseCurlCommandAction: Error creating test plan from cURL command list:[curl --location --request POST '' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"'] java.lang.IllegalArgumentException: Unexpected format for command line:curl --location --request POST '' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"', error:Unknown option -h at org.apache.jmeter.protocol.http.curl.BasicCurlParser.parse(BasicCurlParser.java:797) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.parseCommands(ParseCurlCommandAction.java:670) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.actionPerformed(ParseCurlCommandAction.java:619) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) ~[?:?] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) ~[?:?] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?] at java.awt.Component.processMouseEvent(Component.java:6636) ~[?:?] at javax.swing.JComponent.processMouseEvent(JComponent.java:3342) ~[?:?] at java.awt.Component.processEvent(Component.java:6401) ~[?:?] at java.awt.Container.processEvent(Container.java:2263) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:5012) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2321) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2307) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2762) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:743) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] ------------------------- cURL example - blank parameter: curl --location --request POST 'http://example.com/api/somepath' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId=""' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"' Error: ERROR o.a.j.p.h.g.a.ParseCurlCommandAction: Error creating test plan from cURL command:curl --location --request POST 'http://example.com/api/somepath' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR: 127.0.0.1' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId=""' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"', error:begin 0, end 1, length 0 java.lang.StringIndexOutOfBoundsException: begin 0, end 1, length 0 at java.lang.String.checkBoundsBeginEnd(String.java:3720) ~[?:?] at java.lang.String.substring(String.java:1909) ~[?:?] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.setFormData(ParseCurlCommandAction.java:526) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.createSampler(ParseCurlCommandAction.java:313) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.addToTestPlan(ParseCurlCommandAction.java:691) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.actionPerformed(ParseCurlCommandAction.java:636) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) ~[?:?] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) ~[?:?] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?] at java.awt.Component.processMouseEvent(Component.java:6636) ~[?:?] at javax.swing.JComponent.processMouseEvent(JComponent.java:3342) ~[?:?] at java.awt.Component.processEvent(Component.java:6401) ~[?:?] at java.awt.Container.processEvent(Container.java:2263) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:5012) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2321) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2307) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2762) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:743) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] ------------------------- cURL example - blank header: curl --location --request POST 'http://example.com/api/somepath' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR;' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"' Error: 2020-12-23 02:24:10,285 ERROR o.a.j.p.h.g.a.ParseCurlCommandAction: Error creating test plan from cURL command list:[curl --location --request POST 'http://example.com/api/somepath' \ --header 'Accept-Language: it-IT' \ --header 'HTTP_X_FORWARDED_FOR;' \ --form 'FrontsideImage=@"/C:/Users/someuser/Desktop/Desktop.avi"' \ --form 'BacksideImage=@"/C:/Users/someuser/Desktop/Desktop.jpg"' \ --form 'ApplicationTypeId="13"' \ --form 'Country="ITA"' \ --form 'DocumentType="ID_CARD"'] java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 21 at java.lang.String.checkBoundsBeginEnd(String.java:3720) ~[?:?] at java.lang.String.substring(String.java:1909) ~[?:?] at org.apache.jmeter.protocol.http.curl.BasicCurlParser.parse(BasicCurlParser.java:693) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.parseCommands(ParseCurlCommandAction.java:670) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at org.apache.jmeter.protocol.http.gui.action.ParseCurlCommandAction.actionPerformed(ParseCurlCommandAction.java:619) ~[ApacheJMeter_http.jar:5.4.1-SNAPSHOT] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967) ~[?:?] at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308) ~[?:?] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405) ~[?:?] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262) ~[?:?] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279) ~[?:?] at java.awt.Component.processMouseEvent(Component.java:6636) ~[?:?] at javax.swing.JComponent.processMouseEvent(JComponent.java:3342) ~[?:?] at java.awt.Component.processEvent(Component.java:6401) ~[?:?] at java.awt.Container.processEvent(Container.java:2263) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:5012) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2321) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2307) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2762) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4844) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:743) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] Jmeter 5.4.1 4ed732d Microsoft Windows 10 Pro 64-bit java version "1.8.0_251" -- You are receiving this mail because: You are the assignee for the bug.