Skip to content

Commit

Permalink
Fix HTML public conditions (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikPelli authored Dec 21, 2024
1 parent 65f394b commit 9faedc2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ext/html/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,24 @@ import (
"golang.org/x/text/transform"
)

var IsHtml = goproxy.ContentTypeIs("text/html")
var IsHtml goproxy.RespCondition = goproxy.ContentTypeIs("text/html")

var IsCss goproxy.RespCondition = goproxy.ContentTypeIs("text/css")

var IsJavaScript goproxy.RespCondition = goproxy.ContentTypeIs("text/javascript",
"application/javascript")

var IsJson goproxy.RespCondition = goproxy.ContentTypeIs("text/json")

var IsXml goproxy.RespCondition = goproxy.ContentTypeIs("text/xml")

var IsWebRelatedText goproxy.RespCondition = goproxy.ContentTypeIs(
"text/html",
"text/css",
"text/javascript", "application/javascript",
"text/xml",
"text/json",
)

// HandleString will receive a function that filters a string, and will convert the
// request body to a utf8 string, according to the charset specified in the Content-Type
Expand Down

0 comments on commit 9faedc2

Please sign in to comment.