From patchwork Mon Feb 24 10:13:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Edmondson X-Patchwork-Id: 11400135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7EC9F14BC for ; Mon, 24 Feb 2020 10:14:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 548832080D for ; Mon, 24 Feb 2020 10:14:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="t+zMvtk6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 548832080D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:34160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6AkV-00025N-Fc for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Feb 2020 05:14:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41484) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j6Ajx-0001AL-Mb for qemu-devel@nongnu.org; Mon, 24 Feb 2020 05:13:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j6Ajw-00085U-Re for qemu-devel@nongnu.org; Mon, 24 Feb 2020 05:13:29 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:47234) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j6Aju-00084A-IH; Mon, 24 Feb 2020 05:13:26 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01OA9G5t151180; Mon, 24 Feb 2020 10:13:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=LJeousvhsN/r/HfUOSblY4EBPJW7IBcyIJZEvWMokmA=; b=t+zMvtk6um96hkrAWlOiEiQWMhadEbnAAEhTihPpt9htskPMuZkCNuWTjmiXJ0F1is5M MQe5wD5QCu2tuu41iIa5wOs0vz3rM15pGJJYK661IwsgO+kKj3feDRt+XmsSsORUClqc 1vhQnfeEivkj8J9ys90Wnfg52LJ0d1BwL4Fbyd5v2jeUmNR+Vhy617W60JGvUS0i7WJp tpKRjcOs83wBMfl9gekochQ5qU25ddInQMSFxD7rUJTmuEC+LF+vBPfCo0Hm7sfziiBr jw0qeet8/j00w2QE5zlSMeilYQt5H84y2zw0EolZJAjg7yCEzYDUxURQPhBaAYbwqouV iQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2yauqu6cjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Feb 2020 10:13:21 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 01OADLR4070419; Mon, 24 Feb 2020 10:13:21 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2ybdsgax0r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 24 Feb 2020 10:13:21 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 01OADCTO023129; Mon, 24 Feb 2020 10:13:12 GMT Received: from disaster-area.hh.sledj.net (/81.187.26.238) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 24 Feb 2020 02:13:12 -0800 Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id a88fd010; Mon, 24 Feb 2020 10:13:10 +0000 (UTC) From: David Edmondson To: qemu-devel@nongnu.org Subject: [PATCH v3 0/2] block/curl: Improve HTTP header parsing Date: Mon, 24 Feb 2020 10:13:08 +0000 Message-Id: <20200224101310.101169-1-david.edmondson@oracle.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9540 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=1 spamscore=0 malwarescore=0 mlxscore=0 bulkscore=0 mlxlogscore=673 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002240087 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9540 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 bulkscore=0 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxlogscore=731 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002240087 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , David Edmondson , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" An HTTP object store of my acquaintance returns "accept-ranges: bytes" (all lower case) as a header, causing the QEMU curl backend to refuse to talk to it. RFC 7230 says that HTTP headers are case insensitive, so update the curl backend accordingly. At the same time, allow for arbitrary white space around the HTTP header field value, as required by the RFC. v3: - fix line length. v2: - strncasecmp -> g_ascii_strncasecmp (Philippe). - isspace -> g_ascii_isspace, for good measure. David Edmondson (2): block/curl: HTTP header fields allow whitespace around values block/curl: HTTP header field names are case insensitive block/curl.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)