From a1357686702851f0478dd96db5dbd7c0dc03a29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Caletka?= Date: Sun, 14 Jul 2024 10:37:15 +0200 Subject: [PATCH] Remove trailing slash --- configure.ac | 2 +- src/httpclients.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8506b1a..60b4065 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([rtp2httpd], [1.5], [ondrej@caletka.cz]) +AC_INIT([rtp2httpd], [1.6], [ondrej@caletka.cz]) AC_CONFIG_SRCDIR([src/rtp2httpd.h]) AC_CONFIG_HEADERS([src/config.h]) AM_INIT_AUTOMAKE diff --git a/src/httpclients.c b/src/httpclients.c index a3e0ff3..06be3bc 100644 --- a/src/httpclients.c +++ b/src/httpclients.c @@ -481,6 +481,12 @@ void clientService(int s) { } free(method); method=NULL; + /* Strip the trailing slash */ + if (url[strlen(url)-1] == '/') { + logger(LOG_DEBUG, "Stripping trailing /: %s\n", url); + url[strlen(url)-1] = '\0'; + } + urlfrom = rindex(url, '/'); if (urlfrom == NULL || (conf_hostname && strcasecmp(conf_hostname, hostname)!=0)) { if (numfields == 3)