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

Allow HTTP::Server::Context#redirect to take an URL #659

Merged
merged 1 commit into from
Sep 24, 2023

Conversation

xendk
Copy link
Contributor

@xendk xendk commented Jun 10, 2023

Description of the Change

Had a bit of a huh? moment when I discovered that I can't redirect to an URI, but it has to be a string. So I thought #redirect might as well take a String | URI.

Alternate Designs

Could've made an overload, but this looks nicer. Think the compiler will optimize it in any case.

Benefits

Usage looks nicer.

Possible Drawbacks

Possibly a miniscule performance impact, in theory something has to check whether it's a string or URI now, but I believe the compiler is smarter than that.

@sdogruyol
Copy link
Member

Looks like a nice Developer Experience improvement. WDYT @straight-shoota ?

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @xendk 🙏

Copy link
Member

@sdogruyol sdogruyol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @xendk 🙏

@sdogruyol sdogruyol merged commit cb9adcd into kemalcr:master Sep 24, 2023
@xendk xendk deleted the patch-1 branch February 1, 2024 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants