--max-redir is met), this variable will show the actual URL a redirect
\fIwould\fP have gone to. (Added in 7.18.2)
.TP
+.B referer
+The Referer: header, if there was any. (Added in 7.76.0)
+.TP
.B remote_ip
The remote IP address of the most recently done connection - can be either
IPv4 or IPv6 (Added in 7.29.0)
getinfo \
getinmemory \
getredirect \
+ getreferrer \
http-post \
http2-download \
http2-pushinmemory \
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
.IP CURLINFO_RESPONSE_CODE
Last received response code.
See \fICURLINFO_RESPONSE_CODE(3)\fP
+.IP CURLINFO_REFERER
+Referrer header.
+See \fICURLINFO_REFERER(3)\fP
.IP CURLINFO_HTTP_CONNECTCODE
Last proxy CONNECT response code.
See \fICURLINFO_HTTP_CONNECTCODE(3)\fP
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
CURLE_OUT_OF_MEMORY if there was insufficient heap space.
.SH "SEE ALSO"
.BR CURLOPT_USERAGENT "(3), " CURLOPT_HTTPHEADER "(3), "
+.BR CURLINFO_REFERER "(3), "
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
CURLINFO_REDIRECT_TIME.3 \
CURLINFO_REDIRECT_TIME_T.3 \
CURLINFO_REDIRECT_URL.3 \
+ CURLINFO_REFERER.3 \
CURLINFO_REQUEST_SIZE.3 \
CURLINFO_RESPONSE_CODE.3 \
CURLINFO_RETRY_AFTER.3 \
CURLINFO_REDIRECT_TIME 7.9.7
CURLINFO_REDIRECT_TIME_T 7.61.0
CURLINFO_REDIRECT_URL 7.18.2
+CURLINFO_REFERER 7.76.0
CURLINFO_REQUEST_SIZE 7.4.1
CURLINFO_RESPONSE_CODE 7.10.8
CURLINFO_RETRY_AFTER 7.66.0
CURLINFO_RETRY_AFTER = CURLINFO_OFF_T + 57,
CURLINFO_EFFECTIVE_METHOD = CURLINFO_STRING + 58,
CURLINFO_PROXY_ERROR = CURLINFO_LONG + 59,
+ CURLINFO_REFERER = CURLINFO_STRING + 60,
- CURLINFO_LASTONE = 59
+ CURLINFO_LASTONE = 60
} CURLINFO;
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
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;
CURLINFO_CONTENT_TYPE
CURLINFO_FTP_ENTRY_PATH
CURLINFO_REDIRECT_URL
+ CURLINFO_REFERER
CURLINFO_PRIMARY_IP
CURLINFO_RTSP_SESSION_ID
CURLINFO_LOCAL_IP
d c X'0010003A'
d CURLINFO_PROXY_ERROR... CURLINFO_LONG + 59
d c X'0020003B'
+ d CURLINFO_REFERER... CURLINFO_STRING + 60
+ d c X'0010003C'
*
d CURLINFO_HTTP_CODE... Old ...RESPONSE_CODE
d c X'00200002'
{"proxy_ssl_verify_result", VAR_PROXY_SSL_VERIFY_RESULT,
CURLINFO_PROXY_SSL_VERIFYRESULT, writeLong},
{"redirect_url", VAR_REDIRECT_URL, CURLINFO_REDIRECT_URL, writeString},
+ {"referer", VAR_REFERER, CURLINFO_REFERER, writeString},
{"remote_ip", VAR_PRIMARY_IP, CURLINFO_PRIMARY_IP, writeString},
{"remote_port", VAR_PRIMARY_PORT, CURLINFO_PRIMARY_PORT, writeLong},
{"response_code", VAR_HTTP_CODE, CURLINFO_RESPONSE_CODE, writeLong},
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
VAR_REDIRECT_COUNT,
VAR_REDIRECT_TIME,
VAR_REDIRECT_URL,
+ VAR_REFERER,
VAR_REQUEST_SIZE,
VAR_SCHEME,
VAR_SIZE_DOWNLOAD,
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
/* mappings proposed by
* https://freedesktop.org/wiki/CommonExtendedAttributes/
*/
- { "user.xdg.origin.url", CURLINFO_EFFECTIVE_URL },
- { "user.mime_type", CURLINFO_CONTENT_TYPE },
- { NULL, CURLINFO_NONE } /* last element, abort loop here */
+ { "user.xdg.referrer.url", CURLINFO_REFERER },
+ { "user.xdg.origin.url", CURLINFO_EFFECTIVE_URL },
+ { "user.mime_type", CURLINFO_CONTENT_TYPE },
+ { NULL, CURLINFO_NONE } /* last element, abort here */
};
/* returns TRUE if a new URL is returned, that then needs to be freed */
HTTP Location: following with auto-referer
</name>
<command>
-http://%HOSTIP:%HTTPPORT/want/1067 -L --referer "firstone.html;auto"
+http://%HOSTIP:%HTTPPORT/want/1067 --silent --location --referer "firstone.html;auto" --write-out "%{stderr}|%{referer}|"
</command>
</client>
Referer: http://%HOSTIP:%HTTPPORT/want/1067\r
\r
</protocol>
+<stderr nonewline="yes">
+|http://%HOSTIP:%HTTPPORT/want/1067|
+</stderr>
</verify>
</testcase>
\r
</protocol>
<stdout nonewline="yes">
-{"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"log/out970","ftp_entry_path":null,"http_code":200,"http_connect":000,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_connects":1,"num_headers":9,"num_redirects":0,"proxy_ssl_verify_result":0,"redirect_url":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"HTTP","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/970","url_effective":"http://%HOSTIP:%HTTPPORT/970","urlnum":0,"curl_version":"curl-unit-test-fake-version"}
+{"content_type":"text/html","errormsg":null,"exitcode":0,"filename_effective":"log/out970","ftp_entry_path":null,"http_code":200,"http_connect":000,"http_version":"1.1","local_ip":"127.0.0.1","local_port":13,"method":"GET","num_connects":1,"num_headers":9,"num_redirects":0,"proxy_ssl_verify_result":0,"redirect_url":null,"referer":null,"remote_ip":"%HOSTIP","remote_port":%HTTPPORT,"response_code":200,"scheme":"HTTP","size_download":445,"size_header":4019,"size_request":4019,"size_upload":0,"speed_download":13,"speed_upload":13,"ssl_verify_result":0,"time_appconnect":0.000013,"time_connect":0.000013,"time_namelookup":0.000013,"time_pretransfer":0.000013,"time_redirect":0.000013,"time_starttransfer":0.000013,"time_total":0.000013,"url":"http://%HOSTIP:%HTTPPORT/970","url_effective":"http://%HOSTIP:%HTTPPORT/970","urlnum":0,"curl_version":"curl-unit-test-fake-version"}
</stdout>
</verify>
</testcase>