Giter Club home page Giter Club logo

spring-security-8026's Introduction

This is a simple gateway application configured to route requests to some backend service. It has a single page which submits POST requests to that same service.

The gateway uses Spring Security to provide CSRF protection. If CSRF protection is disabled, everything works properly. But when it's enabled, the form POST on the gateway page hangs until it times out.

To reproduce

  1. Configure the gateway to point to some webapp. By default it uses https://webhook.site, but the only thing that matters is that you can verify the requests are received.
    spring:
      cloud:
        gateway:
          routes:
            # See https://webhook.site/#!/ff36f3af-5499-428d-96b2-f0f49469c5e3
            - id: example
              uri: https://webhook.site
              predicates:
                - Path=/**
              filters:
                - PrefixPath=/ff36f3af-5499-428d-96b2-f0f49469c5e3

    Note: If using a url with a path, include it in a PrefixPath filter as shown above.

  2. Run the gateway.
  3. Load the Gateway webpage at http://localhost:9999.
  4. There are two examples of POST requests to the Rest API, a form POST and an AJAX POST. Try submitting both.

Expected Behavior

Both requests should work.

Actual Behavior

The AJAX POST works. The form POST hangs.

Running without CSRF protection

CSRF protection can be disabled by setting csrf.enabled=false in the gateway application.yml. Perform the above steps with CSRF disabled to verify that both POST requests work as expected.

spring-security-8026's People

Contributors

smithjosh avatar

Watchers

 avatar

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.