aboutsummaryrefslogtreecommitdiffstats
path: root/url.c
diff options
context:
space:
mode:
authorTatsuya Kinoshita <tats@debian.org>2019-04-22 12:02:12 +0000
committerGitHub <noreply@github.com>2019-04-22 12:02:12 +0000
commitb0509cee7d56943ed59fcc5eefa1aa1baf9752ea (patch)
tree23072d3586d26ec80327ebb66aeb3ffe28ec6b51 /url.c
parentUpdate ChangeLog (diff)
parentAllow to override UserAgent (diff)
downloadw3m-b0509cee7d56943ed59fcc5eefa1aa1baf9752ea.tar.gz
w3m-b0509cee7d56943ed59fcc5eefa1aa1baf9752ea.zip
Merge pull request #113 from spk/allow-override-user-agent
Allow to override UserAgent
Diffstat (limited to 'url.c')
-rw-r--r--url.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/url.c b/url.c
index 1c17e18..31d7c4b 100644
--- a/url.c
+++ b/url.c
@@ -1324,12 +1324,14 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer)
const int *no_referer_ptr;
int no_referer;
- Strcat_charp(s, "User-Agent: ");
- if (UserAgent == NULL || *UserAgent == '\0')
- Strcat_charp(s, w3m_version);
- else
- Strcat_charp(s, UserAgent);
- Strcat_charp(s, "\r\n");
+ if (!override_user_agent) {
+ Strcat_charp(s, "User-Agent: ");
+ if (UserAgent == NULL || *UserAgent == '\0')
+ Strcat_charp(s, w3m_version);
+ else
+ Strcat_charp(s, UserAgent);
+ Strcat_charp(s, "\r\n");
+ }
Strcat_m_charp(s, "Accept: ", AcceptMedia, "\r\n", NULL);
Strcat_m_charp(s, "Accept-Encoding: ", AcceptEncoding, "\r\n", NULL);