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

add charset detection and override option for html / htm / css / ... #542

Closed
wants to merge 3 commits into from

Conversation

SylRob
Copy link

@SylRob SylRob commented Jul 2, 2019

  • add --charset option:String in config
  • in startEndpoint before handler function check file extension
  • if html | htm | css,
  • if config.charset is set, force every request header Content-type to config.charset content
  • else load the requested file in scanContentTypeCharset and scroll its content to find <meta ... charset="... or @charset "...
  • if found, set the header Content-Type
  • if not set utf-8 default header

the rest is handle bye serve-handeler

Can / should be extended to other extention (json, xml, etc... ?)

Copy link

@alissonpelizaro alissonpelizaro left a comment

Choose a reason for hiding this comment

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

Nothing wrong

@leerob
Copy link
Member

leerob commented Jul 8, 2022

We are rewriting the project in TypeScript - if you are still interested in contributing, could you open a PR against this branch? #706

Thank you!

@leerob leerob closed this Jul 8, 2022
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.

None yet

3 participants