Fix CSRF_TOKEN_COOKIE_NAME wrong reference to VERSION constant#481
Conversation
|
This fix does not seem to work (tried it locally). I think it is because middleware.rb is loaded before the version.rb and at the time Middleware class references VERSION there is no such constant. This would work in runtime but constant is referenced at load time. What helped locally is to EDIT |
Good point! It really is a static definition so the version constant must be loaded already. It should be pretty safe to move the require up since the file does not depend on anything else. Done it here: 90789f9 |
|
I'm seeing the same issue in 2.82 and have tested this PR fix locally. It works great and solves my problem. When can you get this PR merged? Cheers! |
Good to know! I do not have permissions to merge in, but @RobinDaugherty should be able to do so. |
|
Thank you @peaonunes! Even though #480 also fixed the issue, I'm merging yours as well because it changes the order of |
I have not even realised the #480 I kinda did everything on a rush yesterday. Glad I helped 😄 |
It might relate to discussion at #479
After upgrading to
2.8.2I started experiencing the following error:I might have found the issue. I quickly looked at other places using the gem version and saw that they are using
BetterErrors::VERSIONinstead ofVERSION.See:
better_errors/better_errors.gemspec
Lines 5 to 13 in 22b94ff
And see:
better_errors/lib/better_errors/middleware.rb
Lines 166 to 169 in a31224a
Replace the
VERSIONconstant reference in an attempt to solve the issue. Please let me know if that's alright 😄