Commit 45da614
committed
Omit default port from WebSocket handshake Host header (Fix #2480)
The WebSocket upgrade request always appended ":port" to the Host
header, violating RFC 6455 Section 4.1 which says the port should be
included only when it is not the default (80 for ws, 443 for wss).
Some CDNs alter routing when the Host header carries an explicit
default port.
Build the Host header with detail::make_host_and_port_string, which
also brackets IPv6 literal hosts correctly.1 parent f5c8c98 commit 45da614
2 files changed
Lines changed: 52 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8905 | 8905 | | |
8906 | 8906 | | |
8907 | 8907 | | |
8908 | | - | |
| 8908 | + | |
| 8909 | + | |
8909 | 8910 | | |
8910 | 8911 | | |
8911 | 8912 | | |
| |||
8931 | 8932 | | |
8932 | 8933 | | |
8933 | 8934 | | |
8934 | | - | |
| 8935 | + | |
8935 | 8936 | | |
8936 | 8937 | | |
8937 | 8938 | | |
| |||
20570 | 20571 | | |
20571 | 20572 | | |
20572 | 20573 | | |
| 20574 | + | |
| 20575 | + | |
| 20576 | + | |
| 20577 | + | |
| 20578 | + | |
| 20579 | + | |
20573 | 20580 | | |
20574 | | - | |
20575 | | - | |
| 20581 | + | |
| 20582 | + | |
20576 | 20583 | | |
20577 | 20584 | | |
20578 | 20585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18975 | 18975 | | |
18976 | 18976 | | |
18977 | 18977 | | |
| 18978 | + | |
| 18979 | + | |
| 18980 | + | |
| 18981 | + | |
| 18982 | + | |
| 18983 | + | |
| 18984 | + | |
| 18985 | + | |
| 18986 | + | |
| 18987 | + | |
| 18988 | + | |
| 18989 | + | |
| 18990 | + | |
| 18991 | + | |
| 18992 | + | |
| 18993 | + | |
| 18994 | + | |
| 18995 | + | |
| 18996 | + | |
| 18997 | + | |
| 18998 | + | |
| 18999 | + | |
| 19000 | + | |
| 19001 | + | |
| 19002 | + | |
| 19003 | + | |
| 19004 | + | |
| 19005 | + | |
| 19006 | + | |
| 19007 | + | |
| 19008 | + | |
| 19009 | + | |
| 19010 | + | |
| 19011 | + | |
| 19012 | + | |
| 19013 | + | |
| 19014 | + | |
| 19015 | + | |
| 19016 | + | |
| 19017 | + | |
| 19018 | + | |
18978 | 19019 | | |
18979 | 19020 | | |
18980 | 19021 | | |
| |||
0 commit comments