Code Monkey home page Code Monkey logo

Comments (9)

zUniQueX avatar zUniQueX commented on May 26, 2024

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.

mattnelson avatar mattnelson commented on May 26, 2024

How did dw-2.x handle repeated headers/cookies differently?

from dropwizard.

zUniQueX avatar zUniQueX commented on May 26, 2024

@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.

mattnelson avatar mattnelson commented on May 26, 2024

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.

zUniQueX avatar zUniQueX commented on May 26, 2024

@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.

mattnelson avatar mattnelson commented on May 26, 2024

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.

zUniQueX avatar zUniQueX commented on May 26, 2024

@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.

hattad avatar hattad commented on May 26, 2024

@zUniQueX thanks for making the changes. When do you plan on releasing these changes?

from dropwizard.

zUniQueX avatar zUniQueX commented on May 26, 2024

Hi @hattad. The next Dropwizard versions will probably be released next week.

from dropwizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.