开发者

Varnish + Rails causes invalid authenticity tokens in development

开发者 https://www.devze.com 2023-01-10 18:47 出处:网络
Here is my situation. I am testing out Varnish on my local box (I\'m doing some stuff related to page caching that would be a big pain to push to staging every time). Everything works fine, except whe

Here is my situation. I am testing out Varnish on my local box (I'm doing some stuff related to page caching that would be a big pain to push to staging every time). Everything works fine, except whenever I submit a form, I get an ActionController::InvalidAuthenticityToken exception.

Varnish is running on localhost at port 6081, and Thin is running on localhost at port 80. I get the exception when I try to use the site using port 6081.

Is there any way I can get around th开发者_如何学Cis?


Okay, so the reason this was failing was my VCL file was clearing out all cookies on every request. Obviously, this would cause some issues with the authenticity token.

Silly fix for a silly problem :/

0

精彩评论

暂无评论...
验证码 换一张
取 消