Message ID | 20211114172733.71602-15-sbabic@denx.de |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBLEOYWGAMGQEX4RN2QA@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=dok9YTKR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::538; helo=mail-ed1-x538.google.com; envelope-from=swupdate+bncbcxploxj6ikrbleoywgamgqex4rn2qa@googlegroups.com; receiver=<UNKNOWN>) Received: from mail-ed1-x538.google.com (mail-ed1-x538.google.com [IPv6:2a00:1450:4864:20::538]) (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 4HsfRg4RWzz9sWJ for <incoming@patchwork.ozlabs.org>; Mon, 15 Nov 2021 04:28:15 +1100 (AEDT) Received: by mail-ed1-x538.google.com with SMTP id c1-20020aa7c741000000b003e7bf1da4bcsf794649eds.21 for <incoming@patchwork.ozlabs.org>; Sun, 14 Nov 2021 09:28:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1636910893; cv=pass; d=google.com; s=arc-20160816; b=NqutO5HdjRDTmD+3uPBo/8B6/a1MWLVPjLWmu8NegGFpXrrrDE0slecAwzGhDLMqQC jEl+tzrPmAEPr5kHLNDPxn39SIBglvqVnpMsYs8C0OgJrdXSv4vEn3pH0cIEAXXwi8H6 dgcldT5HR4vcAlJ81oRCVzoKCMY9sr8fy69BDCyZ0PdzZuopgDk0W6eS1aQY5hVAdwi8 kHt49Z6GLzkaDVKU0SXbIKmtuTSoA6w13CTMIQTcYPefYD560nr5L8GXLqV8zbiLqo8E oo/7IV20FgwlCAFXzV7rEat2rL36MXxTG4rwsrb/egRSfBkI3S/ex4cNn2QBGW3CwEzG txsw== 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=dFPf+dHKq1zWsP7l1CksZnI4oSh+ktX+3LO+ZckdSpU=; b=HUcmVVh0EpFvqbFxZ182OfeCzAr2IUWtLG8Oh18D8/iXG2pOb2qPLm+A+x5G6+XUfS +QiD7b4Z47nXYW1IaqoDTjSq6BR50Lmf3N+HCUTdI6HcQDcjK5P/byErW1uYWS7N7NzD XqBHXFYxxZaTFjN8dW6417kcIxSXwkCbzgXaSiCTPuwGBdnTtTL0uJv9ks2NHhbuUuqX nmUbKgUZ6Tx+/O+0GW3LgTYxE9XW+8bV2Wi870vcAhL9wkcdT6Ilgx9Epl/lotierdRl B2rqMsvfYXi8uXQErFLfUfs+KxysaXuoU176BEF6aPjGCO4GT0a4AjWD0cA4cezAnFk2 f5cA== 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=dFPf+dHKq1zWsP7l1CksZnI4oSh+ktX+3LO+ZckdSpU=; b=dok9YTKRwnkY1Oem18ujsw/CqIemghHxUuBD0GOvMqbH8QKGwkmF4zwar6puqvSHpD Fb2H2tnOcvn0Opfru7hRS75o4qM2XXvi9PtbiKEI3IulMNfHtGTpVEAaycKJacAjH2WS lcUAtctQ214SGv/1pvxW3w16uWWsTOZ0pUku+JGBUk3G9FKExFktzck6ssVhEDiXLckK CqGR4NZglZHUV5TLY4VqUMhZSgDovLZGSSMw2eh81f6NwwCfnSPvhIuofqY+oRFyekjF 9nQxeScL68cNOtXhlab2cajV8rk5b6J9IpVTwtM3iP6M2t6ob48X0q6Obcv8Yu5W1ylL Td4g== 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=dFPf+dHKq1zWsP7l1CksZnI4oSh+ktX+3LO+ZckdSpU=; b=4SmyaMAvPoP6+F1VGwfAiGFp4IBq007zLnSVi2upOpCPJbcYeBYP22yPGh+RodWLS1 vJyXaZoUaZS5omHuj7tpmpeAEGvOk1kuq3oEE8PYx7JM3T2JegezVNZI/X0g431sUGqU LD5t+UXMMyMEQv1hznj3rhYDQlv1GScrgawQ64xKGugmImuhzBCPdX50cV7iF1NWpaBg gtbipCpBuSWl41Jfa7SznH8g2hQ/4wv5zdQfaUYVAGYTdgAdodGhHa5/58GlnmJIS0kr mIdlz1UROnkcA2gNyfAdWlK/IKFgF25k27lneuEIuEyUmI3In0aXdeXkmT8enO9gmADy 9y+w== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM533GDk6Dc41CbD4CFU/zkUcx1CaREXUKAEaCNh31Z5HRHsYb0JsZ JPVSPngGk9hdvX0yz9AZQXg= X-Google-Smtp-Source: ABdhPJzJWsbr9X/vMER5rD+zcdMKQMih31NedBvOXeXVP1xHQPpPu6PQGDYp1ExZ/3vVsKe1Jkakmg== X-Received: by 2002:a05:6402:124e:: with SMTP id l14mr16209079edw.74.1636910892964; Sun, 14 Nov 2021 09:28:12 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a17:907:3e05:: with SMTP id hp5ls4632172ejc.6.gmail; Sun, 14 Nov 2021 09:28:12 -0800 (PST) X-Received: by 2002:a17:906:6b81:: with SMTP id l1mr41106126ejr.479.1636910892156; Sun, 14 Nov 2021 09:28:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636910892; cv=none; d=google.com; s=arc-20160816; b=iRu1lJgQTjhVS0tbXJB+CkE/xxRDRErxRuB7vYNqlTe7e5twoC7/m5mKEuNQvQ8ueC EEL9n849U83+3+IomHnvZcIqUFVkm5j+zludljZDsUCLp/eVUFXOAis1f755r/FCX6aE z9+Yfi1bgX8ly++XiIaxta3LQLQQDaSXCcOKyfku2x6iR7nP2Z3lyoORcvUdJzgOGKRG xPoMiYdFhvFRnypOpZx0sdE6DRLWjlstYyOanEUfjf9Cz536Nprb9xX+Ym10iZj3umt8 xGPO77kMDjjVZjWVtdy3Xr06kR7hp/3YprlOICe9ZeLytDrV0KjW8/1EMqYr7aNNNmi5 rNhQ== 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=7FNxHvo5WrJ/lAfLMCrq9UHe6gCBHEfjFWS9IXZVeS8=; b=mU4lLpj+So1deAAvm8s6jp0asZapmtDp4D1981QG9fBOEqZiPOkYvyE92cI7TR0OSt gt92/GNjMfJSi+9o6R2umC9dZyrs+9XgyqpRfOONez8BEvyS0k9duCaikfg+MlayXdrJ oAmjlxMh55HtkjbTyFG2skf03zlPSTNkpxrCARF/9qU+MED1BT3LEAvXwznxip99kNMJ EEi9m7XJbyghEh6bLFvDQVi8FRg4emmWqybo2xPFcMMPgEX7NkpcecU0To6JYf0cpTQZ KzP9S1oQNaIuiOL7NapahppI6Xwo26Rm7a6OiiYtKQU3eCwQ6l9jGYuVmKrJEDsljNEJ 3QrA== 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 d2si675794edk.1.2021.11.14.09.28.12 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Nov 2021 09:28:12 -0800 (PST) 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 4HsfRb6n62z1rk5m; Sun, 14 Nov 2021 18:28:11 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4HsfRb6dVcz1qqkB; Sun, 14 Nov 2021 18:28:11 +0100 (CET) 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 tFVM_MzE8_2O; Sun, 14 Nov 2021 18:28:11 +0100 (CET) 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; Sun, 14 Nov 2021 18:28:11 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id D61E04540853; Sun, 14 Nov 2021 18:28:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([IPv6:::1]) by localhost (mail.babic.homelinux.org [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id jFM2CfKcEsVo; Sun, 14 Nov 2021 18:28:08 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id BCAE745426FF; Sun, 14 Nov 2021 18:27:45 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH V2 14/36] channel_curl: do not automatically add charset header Date: Sun, 14 Nov 2021 18:27:11 +0100 Message-Id: <20211114172733.71602-15-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211114172733.71602-1-sbabic@denx.de> References: <20211114172733.71602-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 d1c2f5a..287f827 100644 --- a/corelib/channel_curl.c +++ b/corelib/channel_curl.c @@ -524,6 +524,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(+)