Add a patch to avoid to send User-Agent: - pkgsrc-localpatches - leot's pkgsrc LOCALPATCHES
(HTM) hg clone https://bitbucket.org/iamleot/pkgsrc-localpatches
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) changeset 4dd2925e6ce644349a93b92f9a9804d926283976
(DIR) parent 8e26395eae5f56dcae388b1567bdf1fadea111ca
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Fri, 26 Apr 2019 11:10:45
Add a patch to avoid to send User-Agent:
Diffstat:
www/w3m/patch-url.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff -r 8e26395eae5f -r 4dd2925e6ce6 www/w3m/patch-url.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/www/w3m/patch-url.c Fri Apr 26 11:10:45 2019 +0200
@@ -0,0 +1,23 @@
+$NetBSD$
+
+Do not send User-Agent: header if the UserAgent is not set.
+
+--- url.c.orig 2018-01-25 09:24:48.000000000 +0000
++++ url.c
+@@ -1320,12 +1320,11 @@ otherinfo(ParsedURL *target, ParsedURL *
+ const int *no_referer_ptr;
+ int no_referer;
+
+- Strcat_charp(s, "User-Agent: ");
+- if (UserAgent == NULL || *UserAgent == '\0')
+- Strcat_charp(s, w3m_version);
+- else
++ if (UserAgent != NULL && *UserAgent != '\0') {
++ Strcat_charp(s, "User-Agent: ");
+ Strcat_charp(s, UserAgent);
+- Strcat_charp(s, "\r\n");
++ Strcat_charp(s, "\r\n");
++ }
+
+ Strcat_m_charp(s, "Accept: ", AcceptMedia, "\r\n", NULL);
+ Strcat_m_charp(s, "Accept-Encoding: ", AcceptEncoding, "\r\n", NULL);