You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/03/08 03:52:43 UTC

[incubator-nuttx-apps] branch master updated: webclient: Remove a duplicated "Connection:" header

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new f2737a2  webclient: Remove a duplicated "Connection:" header
f2737a2 is described below

commit f2737a208c4363a1e7736ad3ef3a2eaf74d352f7
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Tue Mar 8 10:45:11 2022 +0900

    webclient: Remove a duplicated "Connection:" header
    
    When making the following change, I haven't noticed that
    g_httpuseragentfields contains a "Connection" header.
    
    ```
    commit 092ce8144445a9b287554e59e3150bab3d67bedb
    Author: YAMAMOTO Takashi <ya...@midokura.com>
    Date:   Mon Mar 7 09:30:23 2022 +0900
    
        webclient: Always use "connection: close" for HTTP 1.1 for now
    
        * This matches the HTTP 1.0 behavior.
    
        * Persistent connection doesn't make much sense with the current API.
    ```
    
    It seems that some servers are not happy with the duplicated header
    and ignore them. (and do the default keep-alive for HTTP 1.1)
    eg. Azure Blob (global)
---
 netutils/webclient/webclient.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c
index 9cb7fb4..7cfb4ee 100644
--- a/netutils/webclient/webclient.c
+++ b/netutils/webclient/webclient.c
@@ -245,7 +245,6 @@ static const char g_httplocation[]         = "location: ";
 static const char g_httptransferencoding[] = "transfer-encoding: ";
 
 static const char g_httpuseragentfields[] =
-  "Connection: close\r\n"
   "User-Agent: "
   CONFIG_NSH_WGET_USERAGENT
   "\r\n\r\n";