Message ID | 20211121103834.922620-15-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBSWD5CGAMGQE33T5QPI@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=oYXvqEwp; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::338; helo=mail-wm1-x338.google.com; envelope-from=swupdate+bncbcxploxj6ikrbswd5cgamgqe33t5qpi@googlegroups.com; receiver=<UNKNOWN>) Received: from mail-wm1-x338.google.com (mail-wm1-x338.google.com [IPv6:2a00:1450:4864:20::338]) (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 4Hxn2Q3NVnz9sf8 for <incoming@patchwork.ozlabs.org>; Sun, 21 Nov 2021 21:39:10 +1100 (AEDT) Received: by mail-wm1-x338.google.com with SMTP id z138-20020a1c7e90000000b003319c5f9164sf8655021wmc.7 for <incoming@patchwork.ozlabs.org>; Sun, 21 Nov 2021 02:39:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1637491147; cv=pass; d=google.com; s=arc-20160816; b=d9MjERw79U5J5cOH4f+n03W6pNBNtQE53E3NSd5RhUdLusmausixvswshzQkzKY/Gx acjzMIBdqid93XU+id8gAiuxlpe1eTnHnzZl2wC1ry+2gRP0G9B6Jfndr3tfIyGAjho9 sRuEVi3w/Nouwcj6eGVGMmmjbnBTzMkZ2Q18/69ojrurP2F/re1++AVQ160S52j+Ks40 EXk8/cldAqYg1o8aiPwyH4S4bwS/x6P/gGF+KPxlBg6cyL4ZHdr0QdddluRDti/GNyjQ ZSCYa5IwyX6lZ7G8nB4Uh/g75PYO74m8hFm2KTHujQSVO0RTxUgA0dViA334em9Y9Ukm 6ifg== 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=O2w8/Jzq03W4T9/qwWNXTJNuOZK3BNyg2QU9aqM1Oh4=; b=HqAf1VO5W0cA0yABR0EcdjCcj/XnktZui+kUTNdNpRXpjLcpwcTOXnWm6nZesiYhjR yOMiPFmCv19u3jgNSGA8E68l0lKQOIKpIZmVSAuZ7crYlSYYHyz0L9sCEJjZ5Mwq22e0 UpWNdF/JrG7YDUyxsmTfJLeX2o1obh8fIGXajXcFbmQadaqINHTJwEBMgvdBoP/vNhBM VSTpUEO3OAuti7EzDi6tLypo1lUnADMbKyXdmh0SHp18RiUbr7XDCqP8PW1QCLgQwxQ0 DXCtbIVmYJeWn+weU03dqovpuSjQQgs3R4klp+YUHZZyOL2t0wUuLAC561O6cc0mZxbr DNIg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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=O2w8/Jzq03W4T9/qwWNXTJNuOZK3BNyg2QU9aqM1Oh4=; b=oYXvqEwpWZrlnTgsMu5Pg5YJBn3EW0ryzA7jJ2yCG9Lhs8fdujptWx37e4AnFjct1+ wC3vKB3X0fI1XcgwRNmNVQ1lBRQVvHcmzobalmrbkKOKeefXlJgSV4UEU8obq5MrXxxP iQ48hQEpjn9xOkQkcD0phrDA1BsChpiZTsfmdCsYeoKRKkT74mHTuKkCKW38Xzg5oU92 8Yue30PvsaWfhRmu4fuR6QENiBUEfyAWCkRMrPY07m0JoPOVFPbdkPQtVyVgL5IBsjEJ 6sM0JH5n4F4zqUhL9C1RbTxe7i/44j9b8U4ty14fxBY7jyaiz1grGeBGLjE/bJByKe5Q YFcQ== 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=O2w8/Jzq03W4T9/qwWNXTJNuOZK3BNyg2QU9aqM1Oh4=; b=2EGZwAJEGuGl3C+s+bOkuh98jxeiFMByn2CtPeA7qSo4lyngebkrWJG34GzbhHlfpM PEiUI5x8oTQ1dz3hS79a1TmfCAzkPuQgvIflkfdxknOzzOa9As5tVSL/pKFC1/Sx0+q/ 0i7y4EZi27fPcMOYpLqAQbM6wr+UN3wxq/iRYl8If4yyz7GGwcRME9ocopy6PzjugANH J96e1ZEH3TeH9T/+WhiNSRApRx/s06E7lfgtRzVU6joPmI1EGJuVHHU7YOKGlTDdCKrq Lu9g2C2ZnwyvVpLuK77g2XonoqmPSoOW8vnBAZ2jNnUXDtY06909nIMVF2Aon9SQ3Xdx 2gJA== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM532q6xnDdXXxxZKS12dRPzvFsNK/Fe3B4SqEXWIV9blYO1z3hE6w GraEYEuh/RAeMYhXGaqsdD8= X-Google-Smtp-Source: ABdhPJwpNNglfvNeyi1MCNdLS7Q81KBu/mw+QkzFX3huEoCpQ+eXN5riV6pcwJRL1rHzIE5xn+ARKQ== X-Received: by 2002:a05:6000:82:: with SMTP id m2mr26157968wrx.202.1637491147188; Sun, 21 Nov 2021 02:39:07 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a1c:1c7:: with SMTP id 190ls9524139wmb.3.canary-gmail; Sun, 21 Nov 2021 02:39:06 -0800 (PST) X-Received: by 2002:a05:600c:4e02:: with SMTP id b2mr18364490wmq.105.1637491146433; Sun, 21 Nov 2021 02:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637491146; cv=none; d=google.com; s=arc-20160816; b=iaZf6ttvwhbEWaGq/4GBUfP9W05zexB+sV/uKjxcJJXGOTD+S6xkDwTm4yNdiPSqN4 3KoDHBEOEaEEgZnFhUpGmqZG7NUU6ElyTJMp58GbD1yN9nfupj4ErG/hoXxmHaSRajsN HRSrJ4tAOzCB5Kn52oXAmdieHDFnPbCUe4fhYZp3dRydUykWjZ4QV61BJyrEHXPfFyy4 WKUAKrawSPMmWliKwFXt0QuCNRB71KQYFfeBkg9+m24f9k3PjwPy1GYfmehVKdJvupeH k/MRTNcIHlDPwSyMrdXxq6XEgiKNenYUqHHX3+sG+eHtMioWXWX5rIZxtFRJdjsctmUi IMnA== 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=GK3u8mCTrZd0gqekfRQ2jrnRENSR1ixPvylVCsS97CjCG8FX6nCrp+7WjyxNLAMkz0 UKK39PBelU9K5fuuTnBPLyhNMxKK7240YBfEvpagPR+dG7360Hto/ccp+umjwXNWaVgl TbicGKsqJKtETXCjx4GKYZuumYxXYQWflx33Ar4mYDwyEqEFVeznDz0Y/794CD4/bVjf ABeLpxsgVaUFZ1qoLrTOs7jYR9c5tLTnK+bHDcLHKPUJ2XbJJ0Yqzx9WUh1CyDvWmGtG I46skN4Ths9k291sBN56Y2X5FwgI9xSrO2wNrnSg3BYFXh62bLEXjUx4xw6WbFPIeUuq Rdow== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 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. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id i17si300429wrb.1.2021.11.21.02.39.06 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Nov 2021 02:39:06 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by domain of sbabic@denx.de) client-ip=212.18.0.9; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Hxn2L1gPSz1qxHk; Sun, 21 Nov 2021 11:39:06 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Hxn2L1SLDz1qqkB; Sun, 21 Nov 2021 11:39:06 +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 IdOxjT9tZBTh; Sun, 21 Nov 2021 11:39:05 +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, 21 Nov 2021 11:39:05 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 6F5124540897; Sun, 21 Nov 2021 11:39:05 +0100 (CET) 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 lpHGZxCjfDUU; Sun, 21 Nov 2021 11:39:02 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.48]) by babic.homelinux.org (Postfix) with ESMTP id 534FF4542900; Sun, 21 Nov 2021 11:38:39 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH V3 14/37] channel_curl: do not automatically add charset header Date: Sun, 21 Nov 2021 11:38:11 +0100 Message-Id: <20211121103834.922620-15-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211121103834.922620-1-sbabic@denx.de> References: <20211121103834.922620-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: 212.18.0.9 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(+)