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

feat(redirect): allow trailing period in shortlink #454

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

yong-jie
Copy link
Member

Problem

When shortlinks are distributed, they are occasionally included in sentences and therefore have a period appended to them. Some devices aren't smart enough at parsing these shortlinks and include them in the request, causing 404 errors to occur.

Solution

A simple solution would be to tweak the regex of the redirect .get(...) middleware to account for a possible trailing period in the shorturl and ignore it in the handler.

Copy link
Contributor

@LoneRifle LoneRifle left a comment

Choose a reason for hiding this comment

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

I'm really unhappy with this but can understand why we have to do it.

@LoneRifle LoneRifle merged commit 8824527 into develop Aug 21, 2020
xming13 pushed a commit to xming13/GoGovSG that referenced this pull request Aug 21, 2020
@yong-jie yong-jie deleted the ignore-trailing-period branch August 24, 2020 06:31
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.

2 participants