Skip to content

Commit

Permalink
refactor: 更新依赖项
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed May 20, 2024
1 parent 82fde6d commit 38fa07c
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 24 deletions.
4 changes: 2 additions & 2 deletions cmd/web/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ require (
github.com/issue9/cmdopt v0.13.1
github.com/issue9/localeutil v0.26.9
github.com/issue9/logs/v7 v7.6.1
github.com/issue9/mux/v8 v8.1.1
github.com/issue9/mux/v8 v8.2.0
github.com/issue9/query/v3 v3.1.3
github.com/issue9/sliceutil v0.16.1
github.com/issue9/source v0.11.1
github.com/issue9/source v0.11.3
github.com/issue9/term/v3 v3.2.9
github.com/issue9/version v1.0.8
github.com/issue9/web v0.94.1
Expand Down
8 changes: 4 additions & 4 deletions cmd/web/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/issue9/localeutil v0.26.9 h1:T8qZICA9LshXrW6W3txReps4XalgTUn273M4oSXi
github.com/issue9/localeutil v0.26.9/go.mod h1:TNoqmrux5wJwS2ZcZw4qwMPJx8nmxta5OchfAKQbYaI=
github.com/issue9/logs/v7 v7.6.1 h1:eUuzmj0USsFR8mMHrtcJcMym175F6Boen3pmAD7rBhE=
github.com/issue9/logs/v7 v7.6.1/go.mod h1:qB5EKf6G+CkVQbHhWmaClhP8OkWzdAhCWvk9FJ1CJqA=
github.com/issue9/mux/v8 v8.1.1 h1:LhDrYz1+1KTaylIniinRFhiXvnLKhdvcp/fibXiJWeA=
github.com/issue9/mux/v8 v8.1.1/go.mod h1:lutTRmqmf2XUsD05nVSdPZ4JO1qPZ1KsUYVjKzj/F9w=
github.com/issue9/mux/v8 v8.2.0 h1:omveRyjxFa13tyrmwzoJnLb9GlJNCjDGB/nJA/V6n+4=
github.com/issue9/mux/v8 v8.2.0/go.mod h1:+nzRMVO5mFWr3PhKvhtdGuiW2bIKuk/mJocF7sb0MJw=
github.com/issue9/query/v3 v3.1.3 h1:Y6ETEYXxaKqhpM4lXPKCffhJ72VuKQbrAwgwHlacu0Y=
github.com/issue9/query/v3 v3.1.3/go.mod h1:a/W/+7iel9K+5rRT4AFAKR8+OJeV5axeF6tK9My4lNA=
github.com/issue9/rands/v3 v3.0.1 h1:EnX9WNushGgHCzoL/R5eBPaLfvjLO/c7CGHNgLK0JhY=
Expand All @@ -42,8 +42,8 @@ github.com/issue9/scheduled v0.20.0 h1:tFehe5MhCUNS/E9VC8et0uO7N1Z09PmOAPWZD0cMW
github.com/issue9/scheduled v0.20.0/go.mod h1:zx5rYymWhJpHWXa9CchbzXa0VqBMUPNGV3n9fBUhe9c=
github.com/issue9/sliceutil v0.16.1 h1:NVZ2feN014oUmMpZvZUrKkKMGhAfzT8WNzJF81krebM=
github.com/issue9/sliceutil v0.16.1/go.mod h1:ldun6sT4/bOJxuMtOXhtc6P7GCwE7L+avV86HNks7qk=
github.com/issue9/source v0.11.1 h1:nLb8k8TtMr9CZOx6NWiAAgVJ3caJotkrLVZSv9RYV48=
github.com/issue9/source v0.11.1/go.mod h1:MQYr1hupicwivCqFSH4FAc+eMT6VMTmKTNJOvqRacG0=
github.com/issue9/source v0.11.3 h1:rXKHyy8Lg2dDlie02TaYJJtbyR9wt4to8CAVbFXR3D0=
github.com/issue9/source v0.11.3/go.mod h1:MQYr1hupicwivCqFSH4FAc+eMT6VMTmKTNJOvqRacG0=
github.com/issue9/term/v3 v3.2.9 h1:0hRJjErY0PWzSkoOCwZ1bBxUw8w9ctblNFBZn8Na1kM=
github.com/issue9/term/v3 v3.2.9/go.mod h1:NkoNf6ANL+bIgT2CZFi6aD1Q2yeksxAr2mb+Nhb9+r4=
github.com/issue9/unique/v2 v2.1.0 h1:lE9hstenrbBgDM/Iulv7d75qAYpgoDV8rSRoLmEBHOk=
Expand Down
2 changes: 1 addition & 1 deletion codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ func (e *Codec) acceptEncoding(contentType, h string) (c compressor.Compressor,
continue
}

if accept.Value == qheader.Identity { // 除非 q=0,否则表示总是可以被接受
if accept.Value == header.Identity { // 除非 q=0,否则表示总是可以被接受
identity = accept
}

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ require (
github.com/issue9/errwrap v0.3.2
github.com/issue9/localeutil v0.26.9
github.com/issue9/logs/v7 v7.6.1
github.com/issue9/mux/v8 v8.1.1
github.com/issue9/mux/v8 v8.2.0
github.com/issue9/query/v3 v3.1.3
github.com/issue9/scheduled v0.20.0
github.com/issue9/sliceutil v0.16.1
github.com/issue9/source v0.11.1
github.com/issue9/source v0.11.3
github.com/issue9/term/v3 v3.2.9
github.com/issue9/unique/v2 v2.1.0
github.com/jellydator/ttlcache/v3 v3.2.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ github.com/issue9/localeutil v0.26.9 h1:T8qZICA9LshXrW6W3txReps4XalgTUn273M4oSXi
github.com/issue9/localeutil v0.26.9/go.mod h1:TNoqmrux5wJwS2ZcZw4qwMPJx8nmxta5OchfAKQbYaI=
github.com/issue9/logs/v7 v7.6.1 h1:eUuzmj0USsFR8mMHrtcJcMym175F6Boen3pmAD7rBhE=
github.com/issue9/logs/v7 v7.6.1/go.mod h1:qB5EKf6G+CkVQbHhWmaClhP8OkWzdAhCWvk9FJ1CJqA=
github.com/issue9/mux/v8 v8.1.1 h1:LhDrYz1+1KTaylIniinRFhiXvnLKhdvcp/fibXiJWeA=
github.com/issue9/mux/v8 v8.1.1/go.mod h1:lutTRmqmf2XUsD05nVSdPZ4JO1qPZ1KsUYVjKzj/F9w=
github.com/issue9/mux/v8 v8.2.0 h1:omveRyjxFa13tyrmwzoJnLb9GlJNCjDGB/nJA/V6n+4=
github.com/issue9/mux/v8 v8.2.0/go.mod h1:+nzRMVO5mFWr3PhKvhtdGuiW2bIKuk/mJocF7sb0MJw=
github.com/issue9/query/v3 v3.1.3 h1:Y6ETEYXxaKqhpM4lXPKCffhJ72VuKQbrAwgwHlacu0Y=
github.com/issue9/query/v3 v3.1.3/go.mod h1:a/W/+7iel9K+5rRT4AFAKR8+OJeV5axeF6tK9My4lNA=
github.com/issue9/rands/v3 v3.0.1 h1:EnX9WNushGgHCzoL/R5eBPaLfvjLO/c7CGHNgLK0JhY=
Expand All @@ -38,8 +38,8 @@ github.com/issue9/scheduled v0.20.0 h1:tFehe5MhCUNS/E9VC8et0uO7N1Z09PmOAPWZD0cMW
github.com/issue9/scheduled v0.20.0/go.mod h1:zx5rYymWhJpHWXa9CchbzXa0VqBMUPNGV3n9fBUhe9c=
github.com/issue9/sliceutil v0.16.1 h1:NVZ2feN014oUmMpZvZUrKkKMGhAfzT8WNzJF81krebM=
github.com/issue9/sliceutil v0.16.1/go.mod h1:ldun6sT4/bOJxuMtOXhtc6P7GCwE7L+avV86HNks7qk=
github.com/issue9/source v0.11.1 h1:nLb8k8TtMr9CZOx6NWiAAgVJ3caJotkrLVZSv9RYV48=
github.com/issue9/source v0.11.1/go.mod h1:MQYr1hupicwivCqFSH4FAc+eMT6VMTmKTNJOvqRacG0=
github.com/issue9/source v0.11.3 h1:rXKHyy8Lg2dDlie02TaYJJtbyR9wt4to8CAVbFXR3D0=
github.com/issue9/source v0.11.3/go.mod h1:MQYr1hupicwivCqFSH4FAc+eMT6VMTmKTNJOvqRacG0=
github.com/issue9/term/v3 v3.2.9 h1:0hRJjErY0PWzSkoOCwZ1bBxUw8w9ctblNFBZn8Na1kM=
github.com/issue9/term/v3 v3.2.9/go.mod h1:NkoNf6ANL+bIgT2CZFi6aD1Q2yeksxAr2mb+Nhb9+r4=
github.com/issue9/unique/v2 v2.1.0 h1:lE9hstenrbBgDM/Iulv7d75qAYpgoDV8rSRoLmEBHOk=
Expand Down
6 changes: 0 additions & 6 deletions internal/qheader/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ import (
xunicode "golang.org/x/text/encoding/unicode"
)

// 一些常用的报头值
const (
Identity = "identity"
KeepAlive = "keep-alive"
)

// ParseWithParam 分析带参数的报头
//
// 比如 content-type 可能带字符集的参数:content-type: application/json; charset=utf-8。
Expand Down
3 changes: 1 addition & 2 deletions mimetype/sse/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/issue9/mux/v8/header"

"github.com/issue9/web"
"github.com/issue9/web/internal/qheader"
)

var messagePool = &sync.Pool{New: func() any { return &Message{} }}
Expand Down Expand Up @@ -74,7 +73,7 @@ func OnMessage(ctx context.Context, l *web.Logger, url string, c *http.Client, m
return err
}
req.Header.Set(header.CacheControl, header.NoCache)
req.Header.Set(header.Connection, qheader.KeepAlive)
req.Header.Set(header.Connection, header.KeepAlive)
req.Header.Set(header.Accept, Mimetype)

if c == nil {
Expand Down
2 changes: 1 addition & 1 deletion mimetype/sse/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (s *Source) connect(ctx *web.Context) {
ctx.Header().Set(header.ContentType, qheader.BuildContentType(Mimetype, header.UTF8))
ctx.Header().Set(header.ContentLength, "0")
ctx.Header().Set(header.CacheControl, header.NoCache)
ctx.Header().Set(header.Connection, qheader.KeepAlive)
ctx.Header().Set(header.Connection, header.KeepAlive)
ctx.WriteHeader(http.StatusOK) // 根据标准,就是 200。

rc := http.NewResponseController(ctx)
Expand Down
2 changes: 1 addition & 1 deletion server/config/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (h *httpConfig) buildInit(l *logs.Logs) {
h.init = func(o *server.Options) {
if len(h.Headers) > 0 {
o.Plugins = append(o.Plugins, web.PluginFunc(func(s web.Server) {
s.Routers().Use(web.MiddlewareFunc(func(next web.HandlerFunc) web.HandlerFunc {
s.Routers().Use(web.MiddlewareFunc(func(next web.HandlerFunc, _, _ string) web.HandlerFunc {
return func(ctx *web.Context) web.Responser {
for _, hh := range h.Headers {
ctx.Header().Add(hh.Key, hh.Value)
Expand Down
2 changes: 1 addition & 1 deletion web.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
)

// Version 当前框架的版本
const Version = "0.94.2"
const Version = "0.95.0"

type (
Logger = logs.Logger
Expand Down

0 comments on commit 38fa07c

Please sign in to comment.