Hi,
I want to set the Referer header in an HTTP request that has a 301/302 Response.
However, even when it is explicitly set in the HTTP request. the Referer that is actually set is the self URL of the request. Is this expected behavior?
Example:
=========================
setUp(scenario("dummy")
.exec(
http("first")
.get("/")
.header(
HttpHeaderNames.
Referer, "
https://facebook.com")
)
.inject(atOnceUsers(1)))
.protocols(
http
.baseUrl("
http://google.com")
.disableWarmUp
.disableCaching
)
=========================
Expected Log
Actual Log
=========================
HTTP request:
GET
http://google.com/headers=
accept: */*
Referer: http://google.com/host:
www.google.com=========================
HTTP response:
status=
301 Moved Permanently
headers=
Location:
http://www.google.com/Content-Type: text/html; charset=UTF-8
Date: Sat, 15 Aug 2020 03:21:25 GMT
Expires: Mon, 14 Sep 2020 03:21:25 GMT
Cache-Control: public, max-age=2592000
Server: gws
Content-Length: 219
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
body=
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="
http://www.google.com/">here</A>.
</BODY></HTML>
<<<<<<<<<<<<<<<<<<<<<<<<<
The only workaround currently is to enable disableFollowRedirect for the request and then follow the redirect manually. However, in my specific use case, I don't want to do that.
Is this expected behavior, or is this a bug?