fix empty feed parsing
This commit is contained in:
parent
9f01f63613
commit
d203d38de6
2 changed files with 6 additions and 0 deletions
|
|
@ -18,6 +18,11 @@ type processor func(r io.Reader) (*Feed, error)
|
|||
func sniff(lookup string) (string, processor) {
|
||||
lookup = strings.TrimSpace(lookup)
|
||||
lookup = strings.TrimLeft(lookup, "\x00\xEF\xBB\xBF\xFE\xFF")
|
||||
|
||||
if len(lookup) < 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
switch lookup[0] {
|
||||
case '<':
|
||||
decoder := xmlDecoder(strings.NewReader(lookup))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue