From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Federico Tedin Newsgroups: gmane.emacs.bugs Subject: bug#33002: 26.1; EWW sends unspecific "Accept: */*" header Date: Sat, 13 Oct 2018 18:59:05 -0300 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1539467894 29053 195.159.176.226 (13 Oct 2018 21:58:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Oct 2018 21:58:14 +0000 (UTC) Cc: 33002@debbugs.gnu.org To: winston@ml1.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 13 23:58:10 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBRvG-0007Sc-71 for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 23:58:10 +0200 Original-Received: from localhost ([::1]:46328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBRxM-0002q1-LF for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Oct 2018 18:00:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gBRx8-0002pt-SC for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 18:00:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gBRx4-0000BU-RN for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 18:00:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gBRx4-0000BN-Mm for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 18:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gBRx4-0004vi-CA for bug-gnu-emacs@gnu.org; Sat, 13 Oct 2018 18:00:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Federico Tedin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Oct 2018 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33002 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33002-submit@debbugs.gnu.org id=B33002.153946796518881 (code B ref 33002); Sat, 13 Oct 2018 22:00:02 +0000 Original-Received: (at 33002) by debbugs.gnu.org; 13 Oct 2018 21:59:25 +0000 Original-Received: from localhost ([127.0.0.1]:48639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBRwT-0004uT-8w for submit@debbugs.gnu.org; Sat, 13 Oct 2018 17:59:25 -0400 Original-Received: from mail-lf1-f49.google.com ([209.85.167.49]:46074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gBRwR-0004uH-Pw for 33002@debbugs.gnu.org; Sat, 13 Oct 2018 17:59:24 -0400 Original-Received: by mail-lf1-f49.google.com with SMTP id n13-v6so943609lfe.12 for <33002@debbugs.gnu.org>; Sat, 13 Oct 2018 14:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=S8oGPX8X4MGXuvVVyMLqeaKTOrElYnyqGLHvHm0tt7I=; b=P6m17qNWa6WUQ7kwir4KCu4vBC+2T80Uzw65fti6u+x6hq3CpDwGs1mHVcF4VMcwsv sUdq+XWNWkABMid1+fu2jyys6X7YMcqBqOpGx7gjjyXJX07+SimZHcn0/QNRlH6jCE96 /XHosToBpzBjMIVCK0o5/ScsuCs45c4/KrUYiF0bRCbFI84+6BWBrEblwvNR3oS/johx 4QfotnOUdauImTT8p0Fmvhm6QE6kYI/KwImuDQcqp5Cr+kHKMb4jQgo5N2NsmNVMZBZi 6+dFiWUmJAHMQJl+KrN+AeAnwNDoGbw9Lb5pjIor2mVRQxEYU9Lq7EzTewSRz8lVrFfE JLxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=S8oGPX8X4MGXuvVVyMLqeaKTOrElYnyqGLHvHm0tt7I=; b=bHdGsP4b2gpCM3p52kkuExz3s0mIrA670DjuUEGTyw/hkxC7xCN1JIbpwCtOu5KvVx y9K3NiHE3cCp86Joi3ngISjVMX9k9bLgyjbNUWhI+R0oKZ9h38VVGXrFhfUcaNm3Lqw/ 98tdb2b3GP2bdyY1C4xr4QkM0qlZcqPmGEdP3nqJK5o8SSVDvCq1n/n7weyAszFDF9Bo JVL4vCqBO454qp4BeZChWLDoNI25u83QD5lbK1RrSFnpK1GuahCbY4gUKlMahvrk95FW UxhIfgIztiRqvUxG1J+dqD0EhRVBQydiNxoCHwhmATz76O4weU/ic5NWhEQ+2azv3IBE 7Qfg== X-Gm-Message-State: ABuFfoimBzFdz7QzjFyc+Y0xuh9r9Xk3w77stRcbmA9Fba/FvcKu/6Cg MNYx/YrgABaTjQUu+ZhjmFyP6JGRRTSo1FJ+mrw= X-Google-Smtp-Source: ACcGV633IxvXZehWwueiINAM65VOYcgnqCz62Dj6zn+rkJSShSZG3137jmTgMCwlcBo1c9Bho2sZyQrjkJ9S6vCg/mU= X-Received: by 2002:a19:9e54:: with SMTP id h81-v6mr6385867lfe.155.1539467957623; Sat, 13 Oct 2018 14:59:17 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:151231 Archived-At: > I noticed EWW sends header "Accept: */*", which appears to prevent > HTTP servers that provide multiple content types from picking a sensible > response content type. > > More information about the Accept header with a list of RFCs at the > bottom of the page can be found here [1]. For comparison lynx sends a > more specific header, which indicates It'd prefer common web content > types before anything else [2]. I experienced this particular bug when > browsing [3], which uses the Accept header to determine when to show the > built-in API Explorer. In a web browser it shows a HTML form to interact > with the API, however actual API clients use "Accept: application/json" > or similar to get the desired format. I've been looking into this problem. It seems that EWW uses url-retrieve to retrieve HTTP contents, which then calls url-http. In url-http, the variable url-mime-accept-string is used as the value for the HTTP Accept header (if it is set to nil, "*/*" is used instead). By default, url-mime-accept-string is set to nil. We could temporarily set the variable url-mime-accept-string with another value when url-retrieve is called by EWW. I am not sure what the default value should be, or if it should be configurable. Maybe the same value used by Lynx would be a good starting point.