apache / apache/jmeter

BasicCurlParser does not support parameterized host/authority in JDK 21

Open
#6,396 0 comments 0 reactions 0 assignees View on GitHub
regression to-triage
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

### 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](https://github.com/user-attachments/assets/7955448a-6a8f-41f1-af4c-7cf1392417c2)

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.