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

fix: remove unreachable condition #154

Closed
wants to merge 1 commit into from
Closed

fix: remove unreachable condition #154

wants to merge 1 commit into from

Conversation

daychongyang
Copy link
Contributor

useless condition

    if (**!(accept.includes('text/html')** || accept.includes('*/*'))) {
      debug(`not redirecting ${ctx.url} (not accepting html)`)
      return next()
    }

    const ext = path.extname(ctx.path)
    if (ext && **!accept.includes('text/html')**) {
      debug(`not redirecting ${ctx.url} (has file extension)`)
      return next()
    }

@yyx990803
Copy link
Member

yyx990803 commented May 15, 2020

It’s not useless. It can happen when accept is */*

@yyx990803 yyx990803 closed this May 15, 2020
@daychongyang
Copy link
Contributor Author

😌

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