mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
fix ipv6 http socket host handling as in RFC2732
This commit is contained in:
parent
2ad6d18c9d
commit
03ca795bd6
@ -412,7 +412,15 @@ event(struct tcp_socket *tcps, void *ptr,
|
|||||||
tcp_socket_send_str(tcps, " HTTP/1.1\r\n");
|
tcp_socket_send_str(tcps, " HTTP/1.1\r\n");
|
||||||
tcp_socket_send_str(tcps, "Connection: close\r\n");
|
tcp_socket_send_str(tcps, "Connection: close\r\n");
|
||||||
tcp_socket_send_str(tcps, "Host: ");
|
tcp_socket_send_str(tcps, "Host: ");
|
||||||
|
/* If we have IPv6 host, add the '[' and the ']' characters
|
||||||
|
to the host. As in rfc2732. */
|
||||||
|
if (strchr(host, ':')) {
|
||||||
|
tcp_socket_send_str(tcps, "[");
|
||||||
|
}
|
||||||
tcp_socket_send_str(tcps, host);
|
tcp_socket_send_str(tcps, host);
|
||||||
|
if (strchr(host, ':')) {
|
||||||
|
tcp_socket_send_str(tcps, "]");
|
||||||
|
}
|
||||||
tcp_socket_send_str(tcps, "\r\n");
|
tcp_socket_send_str(tcps, "\r\n");
|
||||||
if(s->postdata != NULL) {
|
if(s->postdata != NULL) {
|
||||||
if(s->content_type) {
|
if(s->content_type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user