Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types to HTTP::StaticFileHandler #13778

Merged

Conversation

jkthorne
Copy link
Contributor

This adds types to StaticFuleHandler initialize and move the assignment to the arg assignemnt

This adds types to StaticFuleHandler initialize and move the assignment to the arg assignemnt
@straight-shoota
Copy link
Member

straight-shoota commented Aug 29, 2023

Hm, this is technically a breaking change because things like HTTP::StaticFileHandler.new("", fallthrough: nil) did work before this change. I don't think there would be any reasonable justification for that, but it's possible 🤷

So maybe we should add an unrestricted overload just to be safe?

# :ditto:
@[Deprecated]
def self.new(public_dir : String, fallthrough = true, directory_listing = true)
  new(public_dir, fallthrough: fallthrough, listing: listing)
end

I don't know... maybe that's too much caution. I cannot see an actual justified use case for a non-Bool type parameter.

@jkthorne jkthorne force-pushed the types/static-file-handler/init branch from 81d358f to 73f16b1 Compare August 29, 2023 21:37
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
@Blacksmoke16
Copy link
Member

Why add the breaking change label again? It should no longer be due to the new overload.

@straight-shoota
Copy link
Member

It adds a depreciation and deprecations are marked as breaking changes.

@HertzDevil
Copy link
Contributor

Don't we now have a separate deprecation tag

@straight-shoota
Copy link
Member

Oops right. Guess I was out on vacation for too long 😏

@beta-ziliani beta-ziliani added this to the 1.10.0 milestone Sep 7, 2023
@straight-shoota straight-shoota merged commit 29e1e00 into crystal-lang:master Sep 12, 2023
53 checks passed
@straight-shoota straight-shoota changed the title Add types to HTTP::StaticFileHandler Add types to HTTP::StaticFileHandler Sep 20, 2023
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Co-authored-by: Sijawusz Pur Rahnama <sija@sija.pl>
Co-authored-by: Jack Thorne <jack@myrenee.io>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants