Answered question

How can I add a header element like an "X-Forwarded-For"

Hi,

we need to add a header element to all the requests of our VU :

X-Forwarded-For=127.0.0.1

Tanguy L.
Tanguy L.

Tanguy L.

Level
0
4 / 100
points
Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

There's no option to bulk add an HTTP header in the requests. You can only do it manually on each individual request.

However, there's maybe a way to do it. You could use the search and replace feature to bulk modify the name of an existing HTTP header. For example, the cookie header in the recorded request is not necessary to replay a script since it is dynamically handled (except for client cookie).

So the workaround would be to bulk rename the cookie header name by "X-Forwarded-For" and then search again to modify the "X-Forwarded-For" header value to "127.0.0.1".

I used as an example the cookie header but you could also use other HTTP header like "host".

 

Did you find this useful ?

No (0)

Yes (0)

0% of users found this answer useful