mirror of
https://github.com/curl/curl.git
synced 2026-08-25 12:03:39 +03:00
http: add support to read and store the referrer header
- add CURLINFO_REFERER libcurl option
- add --write-out '%{referer}' command-line option
- extend --xattr command-line option to fill user.xdg.referrer.url extended
attribute with the referrer (if there was any)
Closes #6591
This commit is contained in:
parent
70472a44de
commit
44872aefc2
15 changed files with 35 additions and 11 deletions
|
|
@ -145,6 +145,10 @@ static CURLcode getinfo_char(struct Curl_easy *data, CURLINFO info,
|
|||
option had been enabled! */
|
||||
*param_charp = data->info.wouldredirect;
|
||||
break;
|
||||
case CURLINFO_REFERER:
|
||||
/* Return the referrer header for this request, or NULL if unset */
|
||||
*param_charp = data->change.referer;
|
||||
break;
|
||||
case CURLINFO_PRIMARY_IP:
|
||||
/* Return the ip address of the most recent (primary) connection */
|
||||
*param_charp = data->info.conn_primary_ip;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue