I’m new to use Gatling and i’m facing some issues with it.
Indeed, my get request doesn’t keep the headers when there is a redirection. Do you have any suggestions for me?
Here how I’m doing:
val httpConf = http
.userAgentHeader(“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0”)
val header_1 = Map(“Content-Type” → “application/x-www-form-urlencoded”, some → “header” , … )
val scn = scenario(“Scenario 1”)
Are you talking about request or response headers?
Which headers exactly?
What makes you think that those should be kept?
Can you share a reproducer?
Thanks you for helping.
I’m taking about the request headers. (headers_1 in my example)
When i’m doing wget with my header, i see the redirection with the headers and i get the good response:
wget -d --header=“header1” --header=“header2/” --header=“header3” http://url/
I’ll try to share a reproducer but i don’t know if i can. Do you know if we can somehow force the headers?
I’m having a hard time finding out which headers should be propagated. As usual, RFCs are incomplete at best…
Gatling currently have a close list of propagated headers: https://github.com/gatling/gatling/blob/master/gatling-http/src/main/scala/io/gatling/http/ahc/AsyncHandlerActor.scala#L61-L68
If anyone could help find a pointer to the proper behavior, I’d gladly implement it.
The problem is that my headers was not usual headers.
So, the solution for my issue was to disable the redirection and use the “location” header who contains the url of the redirection to make another call with the headers of my first request:
That’s the workaround.
But I will fix it properly: https://github.com/gatling/gatling/issues/2521
Fixed, thanks for reporting!