diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2019-07-01 13:58:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-01 13:58:33 +0000 |
commit | d6545481aeb15b71f44f4a3b903fbd38703425de (patch) | |
tree | ce5478bd6a172d5e32cc3a68e2e5a748407ff05a /url.c | |
parent | Update ChangeLog (diff) | |
parent | Allow setting User Agent in Siteconf (diff) | |
download | w3m-d6545481aeb15b71f44f4a3b903fbd38703425de.tar.gz w3m-d6545481aeb15b71f44f4a3b903fbd38703425de.zip |
Merge pull request #119 from adamemerson/siteconf-user-agent
Allow setting User Agent in Siteconf
Diffstat (limited to 'url.c')
-rw-r--r-- | url.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1323,10 +1323,13 @@ otherinfo(ParsedURL *target, ParsedURL *current, char *referer) Str s = Strnew(); const int *no_referer_ptr; int no_referer; + const char* url_user_agent = query_SCONF_USER_AGENT(target); if (!override_user_agent) { Strcat_charp(s, "User-Agent: "); - if (UserAgent == NULL || *UserAgent == '\0') + if (url_user_agent) + Strcat_charp(s, url_user_agent); + else if (UserAgent == NULL || *UserAgent == '\0') Strcat_charp(s, w3m_version); else Strcat_charp(s, UserAgent); |