Skip to content

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