-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
base: master
Are you sure you want to change the base?
Conversation
strings.Contains(contentType, "font/") { | ||
// These MIME types should not have textual data. | ||
|
||
if !strings.Contains(contentType, "text/") { |
There was a problem hiding this comment.
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.
func FixCharset(f bool) CollectorOption { | ||
return func(c *Collector) { | ||
c.fixCharset = f | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
fixCharset ignore all non text content type