mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/microcosm-cc/bluemonday from 1.0.20 to 1.0.21 (#1004)
Bumps [github.com/microcosm-cc/bluemonday](https://github.com/microcosm-cc/bluemonday) from 1.0.20 to 1.0.21. - [Release notes](https://github.com/microcosm-cc/bluemonday/releases) - [Commits](https://github.com/microcosm-cc/bluemonday/compare/v1.0.20...v1.0.21) --- updated-dependencies: - dependency-name: github.com/microcosm-cc/bluemonday dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
11
vendor/golang.org/x/net/http2/h2c/h2c.go
generated
vendored
11
vendor/golang.org/x/net/http2/h2c/h2c.go
generated
vendored
@ -70,6 +70,15 @@ func NewHandler(h http.Handler, s *http2.Server) http.Handler {
|
||||
}
|
||||
}
|
||||
|
||||
// extractServer extracts existing http.Server instance from http.Request or create an empty http.Server
|
||||
func extractServer(r *http.Request) *http.Server {
|
||||
server, ok := r.Context().Value(http.ServerContextKey).(*http.Server)
|
||||
if ok {
|
||||
return server
|
||||
}
|
||||
return new(http.Server)
|
||||
}
|
||||
|
||||
// ServeHTTP implement the h2c support that is enabled by h2c.GetH2CHandler.
|
||||
func (s h2cHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
// Handle h2c with prior knowledge (RFC 7540 Section 3.4)
|
||||
@ -87,6 +96,7 @@ func (s h2cHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
defer conn.Close()
|
||||
s.s.ServeConn(conn, &http2.ServeConnOpts{
|
||||
Context: r.Context(),
|
||||
BaseConfig: extractServer(r),
|
||||
Handler: s.Handler,
|
||||
SawClientPreface: true,
|
||||
})
|
||||
@ -104,6 +114,7 @@ func (s h2cHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
defer conn.Close()
|
||||
s.s.ServeConn(conn, &http2.ServeConnOpts{
|
||||
Context: r.Context(),
|
||||
BaseConfig: extractServer(r),
|
||||
Handler: s.Handler,
|
||||
UpgradeRequest: r,
|
||||
Settings: settings,
|
||||
|
Reference in New Issue
Block a user