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

fixed fixCharset ignore not enough bug #755

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

Conversation

lorentz-wu
Copy link

fixCharset ignore all non text content type

strings.Contains(contentType, "font/") {
// These MIME types should not have textual data.

if !strings.Contains(contentType, "text/") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree that the original check is too simplistic, but they're a lot of textual MIME types without text/ that might have encoding problems as well. There are application/xhtml+xml, application/xml, application/atom+xml, to name a few.

Comment on lines +467 to +472
func FixCharset(f bool) CollectorOption {
return func(c *Collector) {
c.fixCharset = f
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

How is this different from DetectCharset option?

Copy link
Author

Choose a reason for hiding this comment

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

if fixCharset set false, user can fix charset onResponse

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

2 participants