Comments (9)
Hi @hattad. This has already been discussed in #7203. We can't provide a fully correct implementation with the current logback interface. If we'd 'gracefully' handle this, other users would experience strange behavior because their expected headers will be overridden.
Throwing an exception is the best we can do here to warn users that the request cannot be logged correctly.
from dropwizard.
How did dw-2.x handle repeated headers/cookies differently?
from dropwizard.
@mattnelson The DropwizardJettyServerAdapter
was introduced in Dropwizard 3.x. Previously, logback's server adapter was used. That one overwrites a header map entry once a new header with the same name is encountered.
from dropwizard.
Based on #7203 (comment), 2.1.x and 4.x behave the same way, last header encountered wins. While technically a bug in all 3 versions, it seems like the change in 3.x to throw the exception is a bit harsh since the versions before and after it won't behave that way.
from dropwizard.
@mattnelson We could have used the DropwizardJettyServerAdapter
in Dropwizard 4.x too. The revert of this change was done to prevent having to update our code every time logback changes something.
I've just opened #7962 to prepare Dropwizard 5 and re-introduced the DropwizardJettyServerAdapter
because logback doesn't support Jetty 12 yet. So Dropwizard 5.x will use the same logic as 3.x.
If we merge the change to 4.x, we would stay consistent from 3.x onwards.
from dropwizard.
Since the usage here is for logging, would it be acceptable to reduce the repeated headers into a single comma separated value?
https://stackoverflow.com/a/24502264
from dropwizard.
@mattnelson Since the HTTP RFC allows it, I don't have an objection to that. I've just opened #7965 with the required change.
from dropwizard.
@zUniQueX thanks for making the changes. When do you plan on releasing these changes?
from dropwizard.
Hi @hattad. The next Dropwizard versions will probably be released next week.
from dropwizard.
Related Issues (20)
- Vulnerability issues with dependencies in dropwizard 4.0.1 HOT 1
- IlligalAccesException : module com.fasterxml.jackson.module.blackbird does not read module *** HOT 12
- Incorrect javadocs for io.dropwizard.logging.common.AppenderFactory
- Dropwizard 4.0.3 not logging request logs HOT 2
- AWS Serverless Example HOT 1
- Dropwizard 4.0.2 + Hibernate + ContainerResponseFilter with NameBinding HOT 3
- Jersey client 2.21 doesnt support Transfer-encoding: chunked, is there any workaround?
- Breaking change in a version between 4.0.1 and 4.0.4 HOT 3
- Update Logback to fix CVE-2023-6378? HOT 4
- NPE in tests when a factory is used to inject a value to a resource method parameter HOT 2
- Managed virtual thread pool HOT 2
- Deserialization failures due to Afterburner HOT 1
- Server starts and stops immediately when both enableVirtualThreads and enableAdminVirtualThreads are set to true HOT 5
- delay between tests that use DropwizardExtensionsSupport HOT 2
- Logging request and response body with RequestLogFactory HOT 2
- Dependency Injection issue in AuthFilter HOT 4
- Add cache support for stale-while-revalidate HOT 1
- Redirect log output for commands other than "server" HOT 2
- Enhancement: Make Cli ArgumentParsers locale configurable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dropwizard.