Improved response handling and logging
Javalin previously used a
PrintWriter to write responses,
while Jetty copied to the response
For logging, Javalin used a custom
PrintWriter that would copy the response,
but this would not catch responses written by Jetty (static files).
Javalin now uses a custom
OutputStream for response-logging,
so every response (both Javalin and Jetty-handled) is logged.
Request-logger no longer includes the body of multipart-requests.
Static resource improvements
- GZIP has been enabled
- Cache-control is now set to
max-age=0by default, which means that clients will always ask Jetty if files have been updated - unless:
- If you put files in a dir called
max-agewill be set to one year. This should only be used for versioned library files, like
New functions on Context
ctx.renderMarkdown("/path/to/markdown-file.md")- render and serve a markdown-file
ctx.isMultipart()check if request is multipart