From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Shmakov Newsgroups: gmane.emacs.bugs Subject: bug#17958: eww-submit mishandles the POST method, no action forms Date: Sun, 06 Jul 2014 18:45:05 +0000 Message-ID: <8738eeconi.fsf@violet.siamics.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1404672444 5461 80.91.229.3 (6 Jul 2014 18:47:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jul 2014 18:47:24 +0000 (UTC) To: 17958@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 06 20:47:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X3rT3-0001oX-Kf for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jul 2014 20:47:17 +0200 Original-Received: from localhost ([::1]:46849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3rT3-0008AJ-88 for geb-bug-gnu-emacs@m.gmane.org; Sun, 06 Jul 2014 14:47:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3rSu-00089D-Ov for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 14:47:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3rSo-0003g0-Mj for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 14:47:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54001) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3rSo-0003fp-Et for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 14:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X3rSo-00009N-0j for bug-gnu-emacs@gnu.org; Sun, 06 Jul 2014 14:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ivan Shmakov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 06 Jul 2014 18:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17958 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: submit@debbugs.gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1404672391522 (code B ref -1); Sun, 06 Jul 2014 18:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Jul 2014 18:46:31 +0000 Original-Received: from localhost ([127.0.0.1]:45151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X3rSI-00008L-R5 for submit@debbugs.gnu.org; Sun, 06 Jul 2014 14:46:31 -0400 Original-Received: from fely.am-1.org ([78.47.74.50]:46233) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X3rSF-00008B-6J for submit@debbugs.gnu.org; Sun, 06 Jul 2014 14:46:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=siamics.net; s=a2013295; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Sender:Subject:To:From; bh=O1l39Hlu/KnhWDHCW2/rb9xZ/D3b+jN0Xb/bgl98Qr8=; b=g5y5Z6jn/rSZ2aAK8wJtvhihePScbd+s+KMSSmCFpnhEajT/+EuK7UT7VtPwomB8DBZEXdT8agV8rczmAtouwXmfnYF2AssrYh2okOWSjuWJvk/o3/crpAGJiQmauqUB1uK9/2Jffu0Mak3/URz4thf1+15l7YC+5F7yGqeXhfM=; Original-Received: from host-46-241-38-202.bbcustomer.zsttk.net ([46.241.38.202] helo=waterlily.siamics.net) by fely.am-1.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1X3rSC-0008T4-TP for submit@debbugs.gnu.org; Sun, 06 Jul 2014 18:46:25 +0000 Original-Received: from [2a02:2560:6d4:26ca::1:1d] (helo=violet.siamics.net) by waterlily.siamics.net with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1X3rS6-0000OH-7y for submit@debbugs.gnu.org; Mon, 07 Jul 2014 01:46:18 +0700 Original-Received: from localhost ([::1] helo=violet.siamics.net) by violet.siamics.net with esmtp (Exim 4.80) (envelope-from ) id 1X3rQw-0001eC-2Z for submit@debbugs.gnu.org; Mon, 07 Jul 2014 01:45:06 +0700 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91248 Archived-At: Package: emacs As evidenced with the form at [1], EWW currently (as of 36634f669f2c) mishandles the case where an HTML form uses =E2=80=98method=3D"POST"=E2=80=99 but specifies no =E2=80=98action=E2=80= =99 attribute. Namely, instead of interpreting missing =E2=80=98action=E2=80=99 as meaning =E2=80= =9Cthis very same URI=E2=80=9D, EWW uses the URI with the =E2=80=98path=E2=80=99 compon= ent discarded. Granted, missing =E2=80=98action=E2=80=99 is special-cased for GET forms: 1034 (if (cdr (assq :action form)) 1035 (shr-expand-url (cdr (assq :action form)) 1036 eww-current-url) 1037 eww-current-url) While POST forms get no such treatment: 1030 (eww-browse-url (shr-expand-url (cdr (assq :action form)) 1031 eww-current-url))) However, I believe that the real culprit is shr-expand-url, which mishandles the nil =E2=80=98uri=E2=80=99 case: (mapcar (lambda (x) (shr-expand-url x "http://example.com/welcome/")) '("hello" "/world" nil)) ;; =E2=87=92 ("http://example.com/welcome/hello" "http://example.com/world" "http://example.com") My expectation for the last result would be the =E2=80=98base=E2=80=99 arg= ument unchanged (i.=C2=A0e., http://example.com/welcome/.) Thus, I suggest changing shr-expand-url to return not the 0th element of the (parsed) =E2=80=98base=E2=80=99 (see below), but the 3rd. 596 (cond ((or (not url) 597 (not base) 598 (string-match "\\`[a-z]*:" url)) 599 ;; Absolute URL. 600 (or url (car base))) [1] https://tools.wmflabs.org/guc/?user=3D2001:db8:1337::cafe --=20 FSF associate member #7257 http://boycottsystemd.org/