aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2026-05-27 21:23:34 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2026-05-27 21:23:34 +0000
commit3b647f7b7031fb5421975c7edb713b3ee384454a (patch)
treebedf54d4353aef8159ada33cfecced7475a055db
parentbe786070972fda62081a706082138cd2c32779ae (diff)
downloadtipidee-3b647f7b7031fb5421975c7edb713b3ee384454a.tar.gz
Ignore Host: including for port information when absolute-form
-rw-r--r--src/tipideed/tipideed.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/tipideed/tipideed.c b/src/tipideed/tipideed.c
index 7ca5c0a..b5098af 100644
--- a/src/tipideed/tipideed.c
+++ b/src/tipideed/tipideed.c
@@ -513,14 +513,10 @@ int main (int argc, char const *const *argv, char const *const *envp)
char *p = strchr(x, ':') ;
if (p)
{
- uint16_t port ;
- if (!uint160_scan(p+1, &port) || !port) eexit_400(&rql, "Invalid Host header") ;
+ if (!rql.uri.port)
+ if (!uint160_scan(p+1, &rql.uri.port) || !rql.uri.port)
+ eexit_400(&rql, "Invalid Host header") ;
*p = 0 ;
- if (rql.uri.port)
- {
- if (rql.uri.port != port) eexit_400(&rql, "Port mismatch between Request-Line and Host") ;
- }
- else rql.uri.port = port ;
}
if (!*x || *x == '.') eexit_400(&rql, "Invalid Host header") ;
if (!rql.uri.host) rql.uri.host = x ; /* origin-form or HTTP/1.05 */