* [bitbake][dunfell][1.46][PATCH 0/1] Patch review
@ 2022-08-18 17:08 Steve Sakoman
2022-08-18 17:08 ` [bitbake][dunfell][1.46][PATCH 1/1] fetch2/wget: Update user-agent Steve Sakoman
0 siblings, 1 reply; 2+ messages in thread
From: Steve Sakoman @ 2022-08-18 17:08 UTC (permalink / raw)
To: bitbake-devel
Please review this patch for the upcoming dunfell 3.1.19 release.
Passed a-full on autobuilder:
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4098
The following changes since commit 7fc4cffebf5dcc1d050416c0b7f7d58c765c1d69:
fetch/wget: Move files into place atomically (2022-07-08 06:48:38 -1000)
are available in the Git repository at:
git://git.openembedded.org/bitbake-contrib stable/1.46-nut
http://cgit.openembedded.org/bitbake-contrib/log/?h=stable/1.46-nut
Christophe Priouzeau (1):
fetch2/wget: Update user-agent
lib/bb/fetch2/wget.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [bitbake][dunfell][1.46][PATCH 1/1] fetch2/wget: Update user-agent
2022-08-18 17:08 [bitbake][dunfell][1.46][PATCH 0/1] Patch review Steve Sakoman
@ 2022-08-18 17:08 ` Steve Sakoman
0 siblings, 0 replies; 2+ messages in thread
From: Steve Sakoman @ 2022-08-18 17:08 UTC (permalink / raw)
To: bitbake-devel
From: Christophe Priouzeau <christophe.priouzeau@st.com>
With the usage of enterprise proxy, the user-agent defined are
too old and refused by proxy configuration. Updating to something
more modern is desirable.
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@st.com>
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 7001fdd7c4dca372cbebd8fd2c0b03c5d43f9400)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
lib/bb/fetch2/wget.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index d208f5ee..368c6443 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -52,6 +52,12 @@ class WgetProgressHandler(bb.progress.LineFilterProgressHandler):
class Wget(FetchMethod):
+
+ # CDNs like CloudFlare may do a 'browser integrity test' which can fail
+ # with the standard wget/urllib User-Agent, so pretend to be a modern
+ # browser.
+ user_agent = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0"
+
"""Class to fetch urls via 'wget'"""
def supports(self, ud, d):
"""
@@ -303,7 +309,7 @@ class Wget(FetchMethod):
# Some servers (FusionForge, as used on Alioth) require that the
# optional Accept header is set.
r.add_header("Accept", "*/*")
- r.add_header("User-Agent", "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12")
+ r.add_header("User-Agent", self.user_agent)
def add_basic_auth(login_str, request):
'''Adds Basic auth to http request, pass in login:password as string'''
import base64
@@ -407,9 +413,8 @@ class Wget(FetchMethod):
"""
f = tempfile.NamedTemporaryFile()
with tempfile.TemporaryDirectory(prefix="wget-index-") as workdir, tempfile.NamedTemporaryFile(dir=workdir, prefix="wget-listing-") as f:
- agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12"
fetchcmd = self.basecmd
- fetchcmd += " -O " + f.name + " --user-agent='" + agent + "' '" + uri + "'"
+ fetchcmd += " -O " + f.name + " --user-agent='" + self.user_agent + "' '" + uri + "'"
try:
self._runwget(ud, d, fetchcmd, True, workdir=workdir)
fetchresult = f.read()
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-18 17:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18 17:08 [bitbake][dunfell][1.46][PATCH 0/1] Patch review Steve Sakoman
2022-08-18 17:08 ` [bitbake][dunfell][1.46][PATCH 1/1] fetch2/wget: Update user-agent Steve Sakoman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.