summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2021-02-19 13:57:19 +0000
committerViktor Szakats <commit@vsz.me>2021-02-19 13:57:19 +0000
commit44872aefc2d54f297caf2b0cc887df321bc9d791 (patch)
tree077ea6159543fffdaf7b224014a30088dcdcf5ae /tests
parent70472a44deaff387cf8c8c197e04f3add2a96e2e (diff)
downloadcurl-44872aefc2d54f297caf2b0cc887df321bc9d791.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/data/test10675
-rw-r--r--tests/data/test9702
2 files changed, 5 insertions, 2 deletions
diff --git a/tests/data/test1067 b/tests/data/test1067
index b464c71ca..5790f6b86 100644
--- a/tests/data/test1067
+++ b/tests/data/test1067
@@ -53,7 +53,7 @@ http
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>
@@ -73,5 +73,8 @@ Accept: */*
Referer: http://%HOSTIP:%HTTPPORT/want/1067
</protocol>
+<stderr nonewline="yes">
+|http://%HOSTIP:%HTTPPORT/want/1067|
+</stderr>
</verify>
</testcase>
diff --git a/tests/data/test970 b/tests/data/test970
index 6a89a5455..44c640c94 100644
--- a/tests/data/test970
+++ b/tests/data/test970
@@ -59,7 +59,7 @@ Accept: */*
</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>