Skip to content

Commit

Permalink
fix: directly use bytes reading for xmlBody
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshNarayanJha committed Nov 8, 2024
1 parent 0898a6c commit bd06065
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/pkg/crawl/extractor/xml.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package extractor

import (
"bytes"
"encoding/xml"
"io"
"net/http"
Expand All @@ -23,7 +24,7 @@ func XML(resp *http.Response) (URLs []*url.URL, sitemap bool, err error) {
sitemap = true
}

reader := strings.NewReader(string(xmlBody))
reader := bytes.NewReader(xmlBody)
decoder := xml.NewDecoder(reader)

var (
Expand Down

0 comments on commit bd06065

Please sign in to comment.