Code Monkey home page Code Monkey logo

x-forwarded-filter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

x-forwarded-filter's Issues

Doesn't work for web.xml error-page

Hi,

When an error causes the webapp to use the page defined in the error-page tag in web.xml, this filter doesn't try to handle the error dispatch.

I believe this is due to the code in OncePerRequestFilter.java:

    /**
     * Whether to filter error dispatches such as when the servlet container
     * processes and error mapped in {@code web.xml}. The default return value
     * is "true", which means the filter will not be invoked in case of an error
     * dispatch.
     *
     * @since 3.2
     */
    protected boolean shouldNotFilterErrorDispatch() {
        return true;
    }

Changing that to false fixes the issue for me.
Another option is to override shouldNotFilterErrorDispatch in ForwardedHeaderFilter.java if the desire is to preserve OncePerRequestFilter (which appears to come from Spring).

Could you contribute to Tomcat's RemoteIpValve?

Hi @Michael-Frank

You made a great job, thank you. Unfortunately I can't use your filter and I need to use Tomcat's RemoteIpValve. What I especially need is to populate request.serverName from X-Forwarded-Host.
And I found a ticket with a patch in Bug 57665 - support x-forwarded-host
There in comment I described my situation and why I can't use your filter.
I checked that patch and code of whole RemoteIpValve and I think it can be significantly improved.
At least it would be great if it can support Forwarded header.

Unfortunately ATM I don't enough time to send to Tomcat a new patch but first of all I would like to ask you to contribute as a person who knows better how to implement this.

Can you help with this?
Thank you in advance

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.