Skip to content

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.

2 participants