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

Extend format option to support redirection of trailing slash for directories #136

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

johnnyxwan
Copy link

Extended format option from ( *true | false ) to ( *'follow' | 'redirect' | false ).

'follow' behaves the same as the old true, and keep as default.
'redirect' is used for the redirection new feature.

If trailing slash for directories is absent and index is defined, when format is set to 'redirect', it redirects the page using HTTP 302 to the URL with trailing slash added, at the same time respecting previous scheme and query.

Return value of await send() is true when such a redirection happened, in contrast of undefined when encountering errors and pathname when the file is served.

@johnnyxwan johnnyxwan changed the title Extend format option support redirection of trailing slash for directories Extend format option to support redirection of trailing slash for directories Feb 27, 2020
Copy link
Member

@3imed-jaberi 3imed-jaberi left a comment

Choose a reason for hiding this comment

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

@johnnyxwan thank you for you're PR. can you write the test for these update!

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