From patchwork Sat Jul 29 17:21:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 108947 Delivered-To: patch@linaro.org Received: by 10.182.45.195 with SMTP id p3csp1805964obm; Sat, 29 Jul 2017 10:21:41 -0700 (PDT) X-Received: by 10.99.96.132 with SMTP id u126mr3571359pgb.120.1501348901425; Sat, 29 Jul 2017 10:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501348901; cv=none; d=google.com; s=arc-20160816; b=OumGcYYEeOr8YmKhowP/i18riCCuZ+n7nz+agGrpy+/sIToXOB1rg/KPnBEkinuMWk KYr/4ZhsqZ2NIf5xu+HgyjnH6ScBkevgXv6gCZ1A2rVDRtFoY1azATyZTgVad95LLplz Q8g9CW+qTkY+6OMINU5FSJ5jqODYZCZ/9MTLkmJzggjjNy4b5lp2Th8gxor3wY7kEKLA 1RywZoEPY/rlea9HV+VYlft8kdyFv98bfugGFL0oTsDt9wTFth18mt5DFqcxAuVX67A7 xQMXe4W5iDZh9KP/OszTULmcyiTfXFJs9x+bciGwxfLF5JbVnOnbgVyJhJP6bvgY7HBK wLPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=GVcFVwgWfotSdM3okjwLQHs0Ju14dbtzeYTnfuqEMmw=; b=SGLdUkkcfpAFuCH/RXDlarj+oUumh3sNEqdfeVi/dAQMFBqVxq37kwkahPCJaiDhyC ir3g64c2Q+7cyk8apeJ527nwXXZw/bP5CLHC+DKzv+knMVKOed150okH/7yxN/0LXfJA B6pocMu5/MUYKfdu+uiAhKCjz+pM/penufiNBe8DLs2QyJWjgk5lRIiopd7XkzlvYFPw 4jIfbsadSnUVfqq2mh/AftIhU948GLawm4obdnUiaLMmZ0tMIaGkmpIfHKDI3hkwmlG5 sH0IDGd5SRHAKSThKW9i3H+aXYTqytkzAhyw51LIE8nRWSP9Fs5dNeqvONvYDcVq42UE zlBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.b=dDXbTdf3; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id o12si12933143plg.979.2017.07.29.10.21.41; Sat, 29 Jul 2017 10:21:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.b=dDXbTdf3; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from review.yoctoproject.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 196DD77E87; Sat, 29 Jul 2017 17:21:36 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by mail.openembedded.org (Postfix) with ESMTP id CF20A601A5 for ; Sat, 29 Jul 2017 17:21:33 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id m85so44253451wma.0 for ; Sat, 29 Jul 2017 10:21:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=Znj/SExElS17JoFWzq0V0679nNkzRgnjFnNXeYstEK8=; b=dDXbTdf3hQpIr0DK4RlvbPQYWHq2TtmmJEgNwwmsA4DWpg1UnCoGxVpQ5gRFDtnGj6 u1ixO4koGpPV/bWz30Bx1ADBnsngQ7D3Yfi7DVnmvxTPv8OmSlfjWw5a6O+vYrytCVZa IFzSEi6JXuE9165/zyE2T80ukAywWklUGUev7Itag5fS8XLswsW5M7AOj0gboqzGbuk5 RNMZ1oKMLSIiafdcxDuv1UKJ4g9IkwDHDEYK1CYVY7hKZxbS9RYO2S1ZGEPiW9o9JnLt sy3K1PrsZMgibfCVIUe23CWJKaDi6HkbbO9GahSUSW7xc1cbVL92NQUvfJgzZ/r1yMdY D3xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Znj/SExElS17JoFWzq0V0679nNkzRgnjFnNXeYstEK8=; b=KfOdzT5AorNo6eKcAZk3hoeuAX4DQw6k+uAG0mPYkJ7XcudhIk+5oXrNKcswmX+Txm NGosUOJyyEQ+i3lIHFa85IVzsR/hVJEb3AFD7XFBgrerOL31dCcMQ4v4P4ZxrltG0DTU PxvU5fpzH1VqtgIAHLVf4KsXPaGMlcrsjM3Opjj3yK1wCsFofwukaun/PjvGT8U1A/sk FjrXgDeKS/O3zCkZjHoSLap2RqZiAshdutitnLV8hbpkhcx3V+qNr/PBjg6ug9Wi7i3N UiYlklHsvM3w8xWvMcpt7lhKNpYFwCJXS6lc8iAU0lcmtv/FFnzTzdFJFZWTKd2Xr00Y jASA== X-Gm-Message-State: AIVw112H1QAIdObzpOiEabva/TXGlGho8IQjA7a7vFJJI97mlfzhOMih B9XIqo3A31d7VwCWifM= X-Received: by 10.28.144.7 with SMTP id s7mr7778136wmd.111.1501348894130; Sat, 29 Jul 2017 10:21:34 -0700 (PDT) Received: from flashheart.burtonini.com (home.burtonini.com. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id l1sm6767394wmb.18.2017.07.29.10.21.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Jul 2017 10:21:33 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Sat, 29 Jul 2017 18:21:29 +0100 Message-Id: <20170729172130.12842-1-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 Subject: [OE-core] [PATCH 1/2] wget: fix FusionForge workaround X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org My previous assertion about FusionForge appears to have been wrong, or FusionForge has changed behaviour, or both. FusionForge now mandates that downloads have the Accept header set, despite that header being optional, and returns a 406 Not Acceptable error if it isn't set. As we were pretending that 406 was actually 405 (Moved) and tried to handle it as a redirect this results in an infinite loop until Python kills the recursion. Delete the handling of 406 as 405, and pass Accept: */* in the headers. Signed-off-by: Ross Burton --- bitbake/lib/bb/fetch2/wget.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index 8ee9769d39b..7c49c2b1282 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py @@ -283,11 +283,6 @@ class Wget(FetchMethod): """ http_error_403 = http_error_405 - """ - Some servers (e.g. FusionForge) returns 406 Not Acceptable when they - actually mean 405 Method Not Allowed. - """ - http_error_406 = http_error_405 class FixedHTTPRedirectHandler(urllib.request.HTTPRedirectHandler): """ @@ -316,7 +311,9 @@ class Wget(FetchMethod): uri = ud.url.split(";")[0] r = urllib.request.Request(uri) r.get_method = lambda: "HEAD" - + # Some servers (FusionForge, as used on Alioth) require that the + # optional Accept header is set. + r.add_header("Accept", "*/*") def add_basic_auth(login_str, request): '''Adds Basic auth to http request, pass in login:password as string''' import base64