Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomRequestLog %q inconsistency with a doc #12482

Closed
wendigo opened this issue Nov 5, 2024 · 1 comment · Fixed by #12483
Closed

CustomRequestLog %q inconsistency with a doc #12482

wendigo opened this issue Nov 5, 2024 · 1 comment · Fixed by #12483
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@wendigo
Copy link

wendigo commented Nov 5, 2024

Jetty version(s)
12.0.14

Jetty Environment
ee10

Java version/vendor (use: java -version)
23

OS type/version

Description
Javadoc says:

%q The query string, prepended with a ? if a query string exists, otherwise an empty string.

Meanwhile the code is:

    private static void logQueryString(StringBuilder b, Request request, Response response)
    {
        append(b, "?" + request.getHttpURI().getQuery());
    }

Append is unconditional which renders empty query string as ?null

How to reproduce?

@wendigo wendigo added the Bug For general bugs on Jetty side label Nov 5, 2024
@joakime
Copy link
Contributor

joakime commented Nov 5, 2024

I wonder if this should produce just a - if there is no query string?

lachlan-roberts added a commit that referenced this issue Nov 6, 2024
Signed-off-by: Lachlan Roberts <lachlan.p.roberts@gmail.com>
lachlan-roberts added a commit that referenced this issue Nov 7, 2024
…LogQuery

PR #12482 - fix bug with CustomRequestLog query string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants