Remove the port part of the hostname + according test suite
patch from prx
This commit is contained in:
parent
1753181bff
commit
ef93e01091
2 changed files with 11 additions and 0 deletions
7
main.c
7
main.c
|
@ -268,6 +268,13 @@ main(int argc, char **argv)
|
|||
*/
|
||||
estrlcpy(file, "/index.gmi", 11);
|
||||
}
|
||||
/* check if client added :port at end of request */
|
||||
pos = strchr(request, ':');
|
||||
if (pos != NULL) {
|
||||
/* end string at :*/
|
||||
pos[0] = '\0';
|
||||
}
|
||||
/* copy hostname from request */
|
||||
estrlcpy(hostname, request, sizeof(hostname));
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue