chore: removed sanitization logic (#3147)

* removed sanitization logic

* to avoid lint err
This commit is contained in:
Paul
2024-03-28 20:14:44 +05:30
committed by GitHub
parent a0846c2818
commit 3605efc4d1
3 changed files with 0 additions and 23 deletions

View File

@@ -6,8 +6,6 @@ import (
"net/http"
"net/url"
"strings"
"github.com/microcosm-cc/bluemonday"
)
type Image struct {
@@ -39,21 +37,9 @@ func GetImage(urlStr string) (*Image, error) {
return nil, err
}
bodyBytes, err = SanitizeContent(bodyBytes)
if err != nil {
return nil, err
}
image := &Image{
Blob: bodyBytes,
Mediatype: mediatype,
}
return image, nil
}
func SanitizeContent(content []byte) ([]byte, error) {
bodyString := string(content)
bm := bluemonday.UGCPolicy()
return []byte(bm.Sanitize(bodyString)), nil
}