luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.57k stars 156 forks source link

Upgrading to 0.30.0 causes error in Lucky::Subdomain settings #1685

Closed wout closed 2 years ago

wout commented 2 years ago

Describe the bug After upgrading from 0.29.0 to 0.30.0 I'm getting the following error:

In lib/lucky/src/lucky/protect_from_forgery.cr:25:18

 25 | if !settings.allow_forgery_protection? || request_does_not_require_protection? || valid_csrf_token?
                   ^------------------------
Error: undefined method 'allow_forgery_protection?' for Lucky::Subdomain::HabitatSettings.class

Lucky::Subdomain::HabitatSettings.class trace:

  lib/lucky/src/lucky/protect_from_forgery.cr:25

        if !settings.allow_forgery_protection? || request_does_not_require_protection? || valid_csrf_token?
            ^~~~~~~~

  macro create (in /home/wout/Code/crystal/zow-v6/lib/habitat/src/habitat.cr:158):19

        def settings
            ^~~~~~~~

  macro create (in /home/wout/Code/crystal/zow-v6/lib/habitat/src/habitat.cr:158):20

          HabitatSettings

Versions (please complete the following information):

Additional context Adding setting allow_forgery_protection : Bool = true to the habitat settings of Lucky::Subdomain fixes the issue.