From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] pkg-download: fix fetching URLs with ? from PRIMARY/SECONDARY
Date: Sun, 23 Oct 2016 11:09:14 +0200 [thread overview]
Message-ID: <87d1iro2it.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20161022150413.25a85c1c@free-electrons.com> (Thomas Petazzoni's message of "Sat, 22 Oct 2016 15:04:13 +0200")
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
> Hello,
> There is nothing named "SECONDARY" in Buildroot, it's called "BACKUP".
> This can be fixed when applying the patch.
> On Fri, 21 Oct 2016 22:27:15 +0200, Arnout Vandecappelle
> (Essensium/Mind) wrote:
>> Some packages download files (especially patches) with a ? in the
>> URL. The ? marks the query part of the URL. However, the downloaded
>> file still contains the ? but from then on it doesn't designate a
>> query part anymore. Therefore, when fetching from PRIMARY or
>> SECONDARY site over http, the server will report a 404 Not Found.
>>
>> To fix, we need to replace the ? with %3F. Obviously, this should
>> be done only when fetching from PRIMARY or SECONDARY. For fetching
>> from the real upstream, the ? really does designate the query part.
> One thing I'm wondering is if the '?' character is the only one that
> needs to be escaped like this, or not.
I believe it is, as we already quote the URLs correctly so they don't
confuse the shell and wget afaik correctly URL encodes URL before
requesting the location from the web server.
It works here at least with lighttpd:
echo ok > '/var/www/url?with&special!characters in'
wget 'http://127.0.0.1/url?with&special!characters in'
--2016-10-23 11:04:49-- http://127.0.0.1/url?with&special!characters%20in
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-10-23 11:04:49 ERROR 404: Not Found.
wget 'http://127.0.0.1/url%3fwith&special!characters in'
--2016-10-23 11:04:27-- http://127.0.0.1/url%3fwith&special!characters%20in
Connecting to 127.0.0.1:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3 [application/octet-stream]
Saving to: ?url?with&special!characters in?
2016-10-23 11:04:27 (316 KB/s) - ?url?with&special!characters in? saved [3/3]
We have seen this problem on sources.buildroot.org as well. I have so
far manually fixed it up by renaming the files to drop ?.., so that will
need to be undone when this gets applied.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2016-10-23 9:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-21 20:27 [Buildroot] [PATCH] pkg-download: fix fetching URLs with ? from PRIMARY/SECONDARY Arnout Vandecappelle
2016-10-22 13:04 ` Thomas Petazzoni
2016-10-23 9:09 ` Peter Korsgaard [this message]
2016-10-23 15:21 ` Arnout Vandecappelle
2016-10-23 12:54 ` Thomas Petazzoni
2016-10-23 15:23 ` Arnout Vandecappelle
2016-10-23 18:31 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d1iro2it.fsf@dell.be.48ers.dk \
--to=peter@korsgaard.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox