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 support for NCSA format is odd when it comes to bad requests #12423

Open
joakime opened this issue Oct 23, 2024 · 0 comments
Open
Labels
Bug For general bugs on Jetty side

Comments

@joakime
Copy link
Contributor

joakime commented Oct 23, 2024

Jetty version(s)
12.0.14

Jetty Environment
Any

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

OS type/version
Any

Description
When reviewing PR #12420 it was noticed that the portion of the NCSA format that means "the first line of the HTTP request" isn't being handled properly in case of errors.

We wind up with BAD /badMessage HTTP/1.0 instead of the actual first line of the HTTP request.

I realize this isn't a thing in HTTP/2 and HTTP/3, but for HTTP/1.x we should strive to accomplish that properly.

The definition of NCSA combined format can be defined like this ...

%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i"

    %h: the client hostname or IP address
    %l: the client identifier or - if none is set
    %u: the username used by the client for authentication or - if none is set
    %t: the date and time of the HTTP request
    %r: the first line of the HTTP request
    %s: the status code of the HTTP response
    %b: the byte size of the HTTP response
    %{Referer}i: the URL that linked to the requested page or - if none is set
    %{User-agent}i: the web browser and platform used by the client

This is the structure that NCSA tooling (like varnish) uses when it parses the already produced NCSA request log.

@joakime joakime added the Bug For general bugs on Jetty side label Oct 23, 2024
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
None yet
Development

No branches or pull requests

1 participant