From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniele Nicolodi Newsgroups: gmane.emacs.devel Subject: Re: Bug in url-retrieve-synchronously from url.el on redirect Date: Fri, 10 Jul 2020 14:32:37 -0600 Message-ID: References: <08fad79e-9b6b-6ff4-66fd-c32fdf5b7189@grinta.net> <8d25cbf6-5cc8-25d5-89bc-5a7a74d477c4@grinta.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10158"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 Cc: Emacs developers To: Yuri Khan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 10 22:33:35 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jtziB-0002Xj-MS for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Jul 2020 22:33:35 +0200 Original-Received: from localhost ([::1]:33800 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtziA-0000DD-KA for ged-emacs-devel@m.gmane-mx.org; Fri, 10 Jul 2020 16:33:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtzhN-0008BU-Pz for emacs-devel@gnu.org; Fri, 10 Jul 2020 16:32:46 -0400 Original-Received: from grinta.net ([109.74.203.128]:55744) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtzhL-0004Zy-T5 for emacs-devel@gnu.org; Fri, 10 Jul 2020 16:32:45 -0400 Original-Received: from black.local (c-73-229-170-236.hsd1.co.comcast.net [73.229.170.236]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id 32EF7E0ED8; Fri, 10 Jul 2020 20:32:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1594413162; bh=+7VHDvu/eRwQ7YHshEpRTPPSMPKCaoBNVFJnK3jt3ek=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Z+OI+jYA8L7/0UkKfG8SZmBwYopIPdJfSNY/MOwXFbQqrty+svNr8Lt7G2ZZXV9FR bYrFZkkuwsMe5qSu3emn3lL+CD8mCNr+qMULjbLmM3umnmNgO64f+7wDXe3rtUlv8k 1tsgYfPyz2en4/EB0eDZ9+R8xEkkmvDLDb+wWHGZsEMl3N/s9i8sYAN3gMlRy9L+CE bgCdaNVKyJeKI/WXt7xUEhc9rpf1LvpHYNbzlhIaq0vbMPec0rzxLpvZyPmweWWLmn 3ymBGK7Ern7+lVFDWfDt7kzEUzNNIXkjIxYEnFVFCqJsQenk+itc5QW1VsBn0fVcNf hnEHRR9qqMY8A== In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=109.74.203.128; envelope-from=daniele@grinta.net; helo=grinta.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/10 14:18:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:252840 Archived-At: On 10/07/2020 14:25, Yuri Khan wrote: > On Sat, 11 Jul 2020 at 02:43, Daniele Nicolodi wrote: > >> As far as I understand the RFCs (and being wrong before, I may be wrong >> again) do not allow for < > quoting either. Why does url-http.el strip >> them? Why does it break the URI at the first space if spaces are not >> allowed? > > I cannot answer that, maybe someone who is knowledgeable about > uri-http.el chimes in. > > RFC 7231 allows clients to attempt to DTRT with invalid Location URIs > in any way they deem appropriate; you could argue for a different > recovery heuristic. Me, I’d rather have things break loudly on each > violation, so that it does not go unnoticed for too long. Postel’s > Razor is how we got HTML in its current shape. I tend to agree with you, but, in this specific case, being compatible with other HTTP implementations is a worthwhile goal. Unfortunately, re-defining url-http-parse-headers is the only work-around I found to make Emacs do the less bad thing when dealing with this malformed URIs. Cheers, Dan