apache / apache/jmeter

Ability to getSamplerCreator by header fields other than CONTENT-TYPE

Open
#3,993 1 comment 0 reactions 0 assignees View on GitHub
enhancement os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Michael Chirlin** ([Bug 59614](https://bz.apache.org/bugzilla//show_bug.cgi?id=59614&redirect=false)):
During Proxy recording I have requests that I want to handle with a SampleCreator other than the DeafultSampleCreator, but the SamplerCreatorFactory only lets the Content-Type header determine which creator is used.

I propose to allow other header type fields to select the SamplerCreator. Currently in my local installation I am selecting the SamplerCreator first using the content-type header and then falling back to the accept header:

SamplerCreator creator = samplerCreatorMap.get(request.getContentType());

if (creator == null) {
creator = samplerCreatorMap.get(request.getAccept());
}

But it would probably be better to add an additional method to the SamplerCreator for getManagedAcceptTypes and have two maps samplerCreatorContentTypeMap and samplerCreatorAcceptMap.

What is the best way for me to make suggestions like this? How easy is it to attach the proposed code?

OS: All

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.