Skip to content

Interceptor's method option not working. #9905

@sergiomichels

Description

@sergiomichels

Steps to Reproduce

  1. Create an application
  2. Generate all from some domain class
  3. Create an interceptor that matches only POST actions
class PostInterceptor {

    PostInterceptor() {
        //match(controller: 'person', method: 'POST', action: '*') -> not working
        //match(controller: 'person', action: '*') -> working
        match(method: 'POST') //not working
    }

    boolean before() {
        println "controller action intercepted!"
        true
    }

    boolean after() { true }

    void afterView() {
        // no-op
    }
}

Expected Behaviour

When calling save the interceptor should be used

Actual Behaviour

The method option of the interceptor is not working as expected.

Environment Information

  • Operating System: Win 10
  • Grails Version: 3.1.6
  • JDK Version: 1.8.0_77

DefaultUrlMappingInfo instance have * in the httpMethod property, so it's not matching with 'POST' or any other method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions