jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

BasicCurlParser does not support parameterized host/authority in JDK 21

Open Harshan01 opened this issue 10 months ago • 0 comments

Expected behavior

Import from cURL succeeds with parameterized cURL location option.

Example: curl --location 'http://${domain_envVar}'

Description: In JDK 21, stricter URL parsing is implemented with a property (-Djdk.net.url.delayParsing) to revert to JDK 17 behavior. Since this property can be removed in later versions, JMeter should be able to support URL parsing without the use of JDK's URL. Moreover, URL is deprecated since JDK 20, and recommended URI class does not support the delayed parsing property.

https://bugs.openjdk.org/browse/JDK-8295750

https://github.com/microsoft/openjdk-jdk21u/commit/bd41428a5602e59034e61bf34eed686d4c7b052a

Actual behavior

Import from cURL fails with Cannot invoke "String.length()" because "spec" is null.

image

Steps to reproduce the problem

Use "Import from cURL" feature in JMeter and use JMeter parameter syntax (e.g. ${var}) in the location or URL parameter.

JMeter Version

5.6.3

Java Version

openjdk version "21.0.5" 2024-10-15 LTS

OS Version

No response

Harshan01 avatar Dec 25 '24 14:12 Harshan01