Bug 59614 - Ability to getSamplerCreator by header fields other than CONTENT-TYPE
Summary: Ability to getSamplerCreator by header fields other than CONTENT-TYPE
Status: NEW
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.0
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-22 23:45 UTC by Michael Chirlin
Modified: 2016-06-12 13:35 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Chirlin 2016-05-22 23:45:15 UTC
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?
Comment 1 Philippe Mouawad 2016-06-12 13:35:33 UTC
Hello,
The best thing is to open a discussion on dev mailing list:
- http://jmeter.apache.org/mail.html

For contribution read this:

- http://jmeter.apache.org/building.html

Thanks