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(component): can't access local file by http-server while file not named latin alphabet #34

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

kavience
Copy link

@kavience kavience commented Jan 7, 2022

Proposed changes

more detail can see the issue: https://github.com/adonisjs/core/issues/3478

Types of changes

What types of changes does your code introduce?

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

Further comments

@RomainLanz
Copy link
Member

Hey @kavience! 👋🏻

Could you add also some tests?

@kavience
Copy link
Author

kavience commented Jan 8, 2022

@RomainLanz OK 👌🏻

@kavience kavience force-pushed the fix-local-file-server branch from 5593142 to ae4978e Compare January 8, 2022 07:41
@kavience
Copy link
Author

kavience commented Jan 8, 2022

@RomainLanz done, could you help review that, thank you!

@kavience kavience force-pushed the fix-local-file-server branch from ae4978e to 1fd24d2 Compare January 12, 2022 01:54
@kavience
Copy link
Author

How about now?

 let location = request.param(LocalFileServer.filePathParamName).join('/')
  try {
    location = decodeURIComponent(location)
  } catch (error) {
    // keep location should be raised as it is
  }

when location can't be decoded, keep origin location

@RomainLanz
Copy link
Member

What is your opinion on this @thetutlage?

@thetutlage
Copy link
Member

Looks good to me!

@thetutlage thetutlage merged commit 108579c into adonisjs:develop Jan 17, 2022
@thetutlage
Copy link
Member

Thanks for the PR :)

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