Java – how to disable playback 2.6 csrffilter

I was recently migrated to 2.6. When I called my API from the postman about filters, I got 403 replies

At first, when I ran my service, I received this error

So I'm in application Conf added:

play.filters.hosts {
  allowed = ["."]
}

It solved the problem, but I was never forced to do so

Instead of my error trying to get the action API method:

Well, a get method works, and post sends the above error

I know it has something to do with rest safety, but I've never been forced to think about it. What should I do? I know the filter

Solution

Disable playback csrffilter added to your application conf:

play.filters.disabled+=play.filters.csrf.CSRFFilter
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>