From 30afa469e95f59c57f956981a6381b32b749fcc2 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Wed, 28 Jun 2023 12:37:50 +0000 Subject: [PATCH] back to original patch in PR66672 Since QSNONE will skip splitoutqueryargs, it's where we should fixup the trailing ? git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1910662 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_rewrite.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 7fb4e92c0de..47f575b2586 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -3909,10 +3909,12 @@ static const char *cmd_rewriterule(cmd_parms *cmd, void *in_dconf, } if (*(a2_end-1) == '?') { - *(a2_end-1) = '\0'; /* trailing ? has done its job */ /* a literal ? at the end of the unsubstituted rewrite rule */ - if (!(newrule->flags & RULEFLAG_QSAPPEND)) - { + if (!(newrule->flags & RULEFLAG_QSAPPEND)) { + /* trailing ? has done its job. with QSA, splitoutqueryargs + * will handle it + */ + *(a2_end-1) = '\0'; newrule->flags |= RULEFLAG_QSNONE; } } -- 2.47.2