reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

302 automatic redirect should keep the original request information

Open Misaka299 opened this issue 11 months ago • 0 comments

I am writing a function to read user information, but this page has a 302 redirect and REFERER verification, which causes the request code written by reqwest to be inconsistent with the request result of the built-in http tool in idea. By capturing the package, I found that there is no REFERER information in the request after reqwest redirects.

Since the data is too long, I asked chatgpt to help me compare it. chatgpt say: The referer has changed, and accept-encoding is lost. Maybe there are more fields that may be missing... Since this library can handle 302 redirects, I think the design goal of this library should be consistent with the behavior of the network panel of chrome devtools, right?

The packet capture tool I used is Charles.

:method	GET
:scheme	https
:authority	queue.ticketmaster.sg
:path	/?c=tixcraft&e=myprofileuseruser2&ver=v3-php-3.7.1&cver=469&man=My%20Profile%20user%2Fuser&t=https%3A%2F%2Fticketmaster.sg%2Fuser%2Fuser
accept	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-language	zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7
cache-control	no-cache
pragma	no-cache
referer	https://ticketmaster.sg/user/user
user-agent	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
sec-ch-ua	"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"
sec-ch-ua-mobile	?0
sec-ch-ua-platform	"Windows"
sec-fetch-dest	document
sec-fetch-mode	navigate
sec-fetch-site	same-site
sec-fetch-user	?1
upgrade-insecure-requests	1
priority	u=0, i
:path	/?c=tixcraft&e=myprofileuseruser2&ver=v3-php-3.7.1&cver=469&man=My%20Profile%20user%2Fuser&t=https%3A%2F%2Fticketmaster.sg%2Fuser%2Fuser
:scheme	https
:authority	queue.ticketmaster.sg
:method	GET
accept	text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
accept-language	zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7
cache-control	no-cache
pragma	no-cache
priority	u=0, i
referer	https://queue.ticketmaster.sg/
sec-ch-ua	"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"
sec-ch-ua-mobile	?0
sec-ch-ua-platform	"Windows"
sec-fetch-dest	document
sec-fetch-mode	navigate
sec-fetch-site	same-site
sec-fetch-user	?1
upgrade-insecure-requests	1
user-agent	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
accept-encoding	br, deflate, gzip, x-gzip
cookie	Queue-it=u=3f8b48d4-7bd9-4cb1-a8d4-afffbdd3b4c4
cookie	q_i_t_u_i=referrer_https%3A%2F%2Fqueue.ticketmaster.sg%2F~cookiedomain_ticketmaster.sg

Misaka299 avatar Jan 08 '25 12:01 Misaka299