# Httpd connection header bug

**URL:** <https://erlangforums.com/t/httpd-connection-header-bug/1201>\
**Category:** Proposals: Ideas\
**Tags:** httpd\
**Created:** [March 11, 2022, 2:30pm UTC](https://erlangforums.com/t/httpd-connection-header-bug/1201 "2022-03-11T14:30:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmin](https://erlangforums.com/user_avatar/erlangforums.com/mmin/32/2193_2.png) [@mmin](https://erlangforums.com/u/mmin)\
**Post date:** [March 11, 2022, 2:30pm UTC](https://erlangforums.com/t/httpd-connection-header-bug/1201/1 "2022-03-11T14:30:30Z")

</div>

Hi,  
in reference manual there is a claim that httpd is implemented based on RFC 2616. Based on chapters 2.1 and 14.10, comma-separated list of connection-tokens is allowed. This causes a problem when I want to keep the socket alive while upgrading the connection.

So, I think the following code in `httpd_request`:

```erlang
get_persistens(HTTPVersion,ParsedHeader,ConfigDB)->
    case httpd_util:lookup(ConfigDB, keep_alive, true) of
	true->
	    case HTTPVersion of
		%%If it is version prio to 1.1 kill the conneciton
		"HTTP/1." ++ NList ->
		    case proplists:get_value("connection", ParsedHeader,
					     "keep-alive") of  
			%%if the connection is not ordered to go down
			%%let it live The keep-alive value is the
			%%older http/1.1 might be older Clients that
			%%use it.
			"keep-alive" when hd(NList) >= 49 ->
			    true;
			"close" ->
                            false;
			_Connect ->
                            false
		    end; 
		_ ->
		    false
	    end;
	_ ->
	    false
    end.

```

does not support comma-separated values (e.g. when connection header is “upgrade, keep-alive” get\_persistens/3 returns `false`, but IMO it should return `true`. Shouldn’t we split connection header by comma and then search if there is “keep-alive” in list?
