diff options
author | Viktor Szakats <commit@vsz.me> | 2021-02-19 13:57:19 +0000 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2021-02-19 13:57:19 +0000 |
commit | 44872aefc2d54f297caf2b0cc887df321bc9d791 (patch) | |
tree | 077ea6159543fffdaf7b224014a30088dcdcf5ae /src/tool_xattr.c | |
parent | 70472a44deaff387cf8c8c197e04f3add2a96e2e (diff) | |
download | curl-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 'src/tool_xattr.c')
-rw-r--r-- | src/tool_xattr.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tool_xattr.c b/src/tool_xattr.c index b6a00cb01..08e92fa50 100644 --- a/src/tool_xattr.c +++ b/src/tool_xattr.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * 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 @@ -44,9 +44,10 @@ static const struct xattr_mapping { /* 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 */ |