Message ID | 20211011112156.44192-12-sbabic@denx.de |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRB4F4SCFQMGQEVBFEECA@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20210112 header.b=qC6IfU2f; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::53c; helo=mail-ed1-x53c.google.com; envelope-from=swupdate+bncbcxploxj6ikrb4f4scfqmgqevbfeeca@googlegroups.com; receiver=<UNKNOWN>) Received: from mail-ed1-x53c.google.com (mail-ed1-x53c.google.com [IPv6:2a00:1450:4864:20::53c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HSbxJ21XMz9sPB for <incoming@patchwork.ozlabs.org>; Mon, 11 Oct 2021 22:22:28 +1100 (AEDT) Received: by mail-ed1-x53c.google.com with SMTP id u17-20020a50d511000000b003daa3828c13sf15584008edi.12 for <incoming@patchwork.ozlabs.org>; Mon, 11 Oct 2021 04:22:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1633951344; cv=pass; d=google.com; s=arc-20160816; b=y07SPANIMnMbOuJFA4tCT9zR68QqnhzzWpg5OuCQS3seayUirL8o2Sw2Mm3CDC/7AN YK1U9JxPTQcF7/3Jqunj7P6zHlbsylR4nST0US79Jj5MnP+3ve6gf4/9rwJrC8jRTRJg qup5rnnyETVu9IpLv5xQ+hIvcrNFaHRYsLMFIwDTrPWSSyMVl/G8nlBX02ir2WWMRyxC sGfz+u9myLBeBtdgbRBh/baZRqF2Am8r1dJnxmvHkmkTegb+dwxkXa0igmWV9FkYhMZo 1h0i/adkP5Zxq0Qq04rwQx8D65LL0IUiIHuhpqqOGh4QfLhKqCyF5h07UHgydaco1qtj RcQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=Ouam2whv7SFeqb1/77Sg27yrpwNJ2zGwZyXk41TzFxI=; b=umClmiPxIWpZEHBhqmFrgGfaeveFkCk9qFfsAweflRnxzS10Iuy0+VFBL8puESUrtH SA61yGtmAlURyfsTrdakd+aFkrEK4GR7Mr6Rn2Cw0Wp0t8mb9CHZM3sb/1DWr7yODdRM KkuozH9FrEgcMYnY+hAhC3LJG2kI3mw4G2kjMafIAhTsTHQF4n4w+S5elfQ7zH/73eF5 qrOcakmTfmUTagLCYnupB4RWXvjQE/+JyIXvPeWhTV0CoWeDqmU4h02ZFcRbWPmQOndP W0bxGLgi4Z7TbvHwvNJtglY1oW+GdwRr6kU+zVSTnZ4sn8mlcsDWDQGUU0lzQmSAYbHs p7MA== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Ouam2whv7SFeqb1/77Sg27yrpwNJ2zGwZyXk41TzFxI=; b=qC6IfU2fMe3FQ0mRUUGxQ+YFzV5EHfcJGuUiWxzzpJCrcwb36H4GlttpV6AO/8d6bs SHdCuQ9/zs2+Pny5vbnJ6krvYBq4UmfIDHEhEsQEKr2Gvs4W8+QSyylYhpXZh7mnmeXy uiGMzrR8XNl5MwIsAQt6BqDQ0SZhm76Q5oetNMOCQXCPfbM2un8axG8t26AOIh7e4MqM ajJ2Cmm+BqQpyBqGv0CylmJoxdbY63fTFHVV4BWq7IJb/ce2c7iAPK0/38bSC7sJ9p4F w3Hxr4kK3AyLShjwbatchRGKRCM0rG9rURjnGXEcop1dbQ/QX6anfx1ghZkOvAr+udYN Ay5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=Ouam2whv7SFeqb1/77Sg27yrpwNJ2zGwZyXk41TzFxI=; b=RyuiY6KzsaTKCcppakgM1PmaXnUXCADsUwOFICIYTN6k24VNnzYfHefHEa1UwLknF0 fQQSPT1SdV5iGLU4NteIwM76/Y8kR+VFQ9PFa7TLuIei3W5yotzzsN24jC8Q8Omebb3r UgS6KRliRIJxKCrlI9W3KqcgI1YUbEncki1dr9QkkYmOX+XmN5+PIhNEzFR8HE44ew18 Gjndo0Z3jdfY/vPfqdyptJrPzrkL61UD14iV+Wnx4SLn4NtnxJBTUUD7wJsBFK0l/VJR l5YB76Nr5Ak9k2aEaH5P6hL2s8nC/iEM1J/GRhRdAR3Y4ilDcvdhj2+4eRvKLX7Ekg/J Voew== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5330p235R4HEnhwp9LrC5y1HSCaokY+wvdVsibcTn3bC2idVfuM4 PbOibQhYt8i4tTWQOji/B0s= X-Google-Smtp-Source: ABdhPJyPYBs99yInSfYWw0d+57qFIs0DbfPRSUSXcI+AIyp6GpCicM5k2fW5Puro4p+sv7S31/ME1A== X-Received: by 2002:a17:906:3c51:: with SMTP id i17mr25101299ejg.86.1633951344806; Mon, 11 Oct 2021 04:22:24 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:aa7:d39a:: with SMTP id x26ls3585971edq.2.gmail; Mon, 11 Oct 2021 04:22:24 -0700 (PDT) X-Received: by 2002:a05:6402:438f:: with SMTP id o15mr35587841edc.53.1633951344006; Mon, 11 Oct 2021 04:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633951344; cv=none; d=google.com; s=arc-20160816; b=JmEPDXquCOcV+ps8lTItV9Fzjlwvpa7/rh/2+iIYPjGK8GgHDvbai7wL5lRemTnPMw LHhNvQnoXnHs0DI+Xxl8gU32lyC4v+w3OcPv1x8giG1b2HpLnBsY/ZpPYYxV7yaFArVT VrAIKUpSqiKfMjpOciJGKRmYGFaMArxTmlBRSLNvoN+e+jd2tr/R1yq32T9kbdbKn3Et It1td3yLTlcv7JBcKqdJD1Axocg1OUGNojquwIIoZiWZPisUyZLBlvDEEvriLOEan/ZD vqMgbm9IFxqlQuE79VXOGP3JZeGGEiDbyJ74jcR6o1QV9kFIDv8GXKCoDA5K+CXkmBfi 90KA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=nJPQIPks25g/Iiu9OR5BH7xIcqIB3fTq+sihX2wm384=; b=dgMHRHLOVYJPMNRPzw179nXvelG6ZBXY6vTmYR6ufxGnLNdQBwLb4pRDSEiO53SuVp Ba9O2VY7v0kg6a9XrwjIqZt0SuVzaewFYShn1YDdNB6IPsmfioNTxc4A4FPtV6BMcRNN ak2D/jKlXaZgghAZuuH8zhM3TsSuCu23thfQpvLbId2xOFIe7D2DSbx0bGan/nlZj+zH 0HfNE+L6WLrZ+sGIBTcnmQnzVDc6UlqjgSjh1JUAxd5fJsybDOzS65mD/TuISmvY0v6e 0OhYkAQVkiGLyj6z4Rfmh9JNDJDngZuYvRMfnEFAnNtA+El+Gro8TD/ke52lXujtI7rZ 96gQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id r21si561398edq.2.2021.10.11.04.22.23 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Oct 2021 04:22:24 -0700 (PDT) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4HSbxC5Zdzz1sByw; Mon, 11 Oct 2021 13:22:23 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4HSbxC5GL5z1qqkC; Mon, 11 Oct 2021 13:22:23 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id JmHoXgmm5M68; Mon, 11 Oct 2021 13:22:23 +0200 (CEST) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Mon, 11 Oct 2021 13:22:23 +0200 (CEST) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id C73E04540BF1; Mon, 11 Oct 2021 13:22:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i48radoLQOWr; Mon, 11 Oct 2021 13:22:20 +0200 (CEST) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 30EC645425AF; Mon, 11 Oct 2021 13:22:05 +0200 (CEST) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH 11/29] channel_curl: do not automatically add charset header Date: Mon, 11 Oct 2021 13:21:38 +0200 Message-Id: <20211011112156.44192-12-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211011112156.44192-1-sbabic@denx.de> References: <20211011112156.44192-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
DELTA Update
|
expand
|
diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c index 5c88ef7..50d5cc8 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -522,6 +522,17 @@ static channel_op_res_t channel_set_content_type(channel_t *this, result = CHANNEL_EINIT; } } + /* + * Add default charset for application content + */ + if ((!strcmp(content, "application/json") || !strcmp(content, "application/text")) && + (result == CHANNEL_OK)) { + if ((channel_curl->header = curl_slist_append( + channel_curl->header, "charsets: utf-8")) == NULL) { + ERROR("Set channel charset header failed."); + result = CHANNEL_EINIT; + } + } return result; }
If Content-type is set to bytes / binaries, the charset has no meaning. Just add it automatically in case of application/json and application/text. It is still possible to add it in other case, but the caller should add it to the list of headers. Signed-off-by: Stefano Babic <sbabic@denx.de> --- corelib/channel_curl.c | 11 +++++++++++ 1 file changed, 11 insertions(+)