Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.0.0 #595

Merged
merged 2 commits into from
Nov 30, 2023
Merged

1.0.0 #595

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 42 additions & 9 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# Release Notes

---
## 1.0.0

### New Features
- [fail inject](https://github.com/apache/dubbo-go-pixiu/pull/571)
- [add support for header based route](https://github.com/apache/dubbo-go-pixiu/pull/565)
- [Add Maglev hashing LB algorithm](https://github.com/apache/dubbo-go-pixiu/pull/554)
- [triple proxy support import protosets](https://github.com/apache/dubbo-go-pixiu/pull/548)
- [Add GracefulShutdown Signal For Windows ](https://github.com/apache/dubbo-go-pixiu/pull/522)
- [Tracing support dubbo invoke](https://github.com/apache/dubbo-go-pixiu/pull/559)

### Enhancement
- [refactor prometheus metric](https://github.com/apache/dubbo-go-pixiu/pull/573)
- [remove unused pkg imports](https://github.com/apache/dubbo-go-pixiu/pull/574)
- [chore: unnecessary use of fmt.Sprintf](https://github.com/apache/dubbo-go-pixiu/pull/575)
- [chore:use wasm filter build tags add wasm](https://github.com/apache/dubbo-go-pixiu/pull/567)
- [docs:format and change samples link](https://github.com/apache/dubbo-go-pixiu/pull/556)
- [revert gatewayCmd to Run dubbo go pixiu](https://github.com/apache/dubbo-go-pixiu/pull/557)
- [full import format](https://github.com/apache/dubbo-go-pixiu/pull/527)
- [upgrade hessian2 to v1.11.3](https://github.com/apache/dubbo-go-pixiu/pull/516)

### Bugfixes
- [register hashing and array out of bounds and init hashing](https://github.com/apache/dubbo-go-pixiu/pull/530)
- [optimize timeout statusCode](https://github.com/apache/dubbo-go-pixiu/pull/521)
- [optimizing Metric Implementation](https://github.com/apache/dubbo-go-pixiu/pull/528)
- [add and modify nacos config arguments](https://github.com/apache/dubbo-go-pixiu/pull/524)
- [fix NPE when filter config is nil](https://github.com/apache/dubbo-go-pixiu/pull/517)
- [use wasmer-go v1.0.4 which is compatible with mac arm](https://github.com/apache/dubbo-go-pixiu/pull/515)
- [fix sample url using github.com/apache/dubbo-go-pixiu-samples](https://github.com/apache/dubbo-go-pixiu/pull/506)
- [traffic filter fix weight strategy and error handle within Apply method](https://github.com/apache/dubbo-go-pixiu/pull/507)
- [httpfilter loadbalancer does not work when it has spaces between multiple urls](https://github.com/apache/dubbo-go-pixiu/pull/513)

Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/8](https://github.com/apache/dubbo-go-pixiu/milestone/8)

## 0.6.0

### New Features
Expand All @@ -17,7 +50,7 @@
### Enhancement
- [Remove "Types" on Http to dubbo proxy](https://github.com/apache/dubbo-go-pixiu/pull/456)
- [ASoC 2002: Optimization of Pixiu timeout feature ](https://github.com/apache/dubbo-go-pixiu/pull/475)
-
-

### Bugfixes

Expand Down Expand Up @@ -110,7 +143,7 @@ Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/6](https://github
- [Fix filterManager get filters with random order](https://github.com/apache/dubbo-go-pixiu/pull/264)
- [Fix nil issue for timeout filter](https://github.com/apache/dubbo-go-pixiu/pull/278)

Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/5](https://github.com/apache/dubbo-go-pixiu/milestone/5)
Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/5](https://github.com/apache/dubbo-go-pixiu/milestone/5)


## 0.3.0
Expand All @@ -120,25 +153,25 @@ Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/5](https://github
- [add integrate test](https://github.com/apache/dubbo-go-pixiu/pull/183)
- [handle rate limit config update event](https://github.com/apache/dubbo-go-pixiu/pull/196)
- [add otel metric export to prometheus in pixiu](https://github.com/apache/dubbo-go-pixiu/pull/204)
- [make Pixiu Admin config management finer-grained](https://github.com/apache/dubbo-go-pixiu/pull/171)
- [make Pixiu Admin config management finer-grained](https://github.com/apache/dubbo-go-pixiu/pull/171)

### Enhancement
- [update samples/admin](https://github.com/apache/dubbo-go-pixiu/pull/208)
- [update ratelimit samples](https://github.com/apache/dubbo-go-pixiu/pull/206)
- [make router case sensitive](https://github.com/apache/dubbo-go-pixiu/pull/209)
- [add more test case](https://github.com/apache/dubbo-go-pixiu/pull/203)
- [Enrich filter test case](https://github.com/apache/dubbo-go-pixiu/pull/202)
- [Enrich response.go's test case](https://github.com/apache/dubbo-go-pixiu/pull/197)
- [Enrich response.go's test case](https://github.com/apache/dubbo-go-pixiu/pull/197)

### Bugfixes
- [Fix CI check status not match required](https://github.com/apache/dubbo-go-pixiu/pull/199)
- [Fix timeout config overridden](https://github.com/apache/dubbo-go-pixiu/pull/190)
- [Fix/quickstart](https://github.com/apache/dubbo-go-pixiu/pull/191)
- [FixBug: can't delete node by path](https://github.com/apache/dubbo-go-pixiu/pull/201)
- [Fix flow chart](https://github.com/apache/dubbo-go-pixiu/pull/205)
- [Fix reviewdog](https://github.com/apache/dubbo-go-pixiu/pull/195)
Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/4](https://github.com/apache/dubbo-go-pixiu/milestone/4)
- [Fix reviewdog](https://github.com/apache/dubbo-go-pixiu/pull/195)

Milestone: [https://github.com/apache/dubbo-go-pixiu/milestone/4](https://github.com/apache/dubbo-go-pixiu/milestone/4)


## 0.2.1
Expand Down
10 changes: 6 additions & 4 deletions pixiu/pkg/common/constant/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const (
HeaderKeyContextType = "Content-Type"

HeaderKeyAccessControlAllowOrigin = "Access-Control-Allow-Origin"
HeaderKeyAccessControlAllowHeaders = "Access-Control-Allow-Headers"
HeaderKeyAccessControlExposeHeaders = "Access-Control-Expose-Headers"
HeaderKeyAccessControlAllowMethods = "Access-Control-Allow-Methods"
HeaderKeyAccessControlMaxAge = "Access-Control-Max-Age"
Expand Down Expand Up @@ -48,10 +49,11 @@ const (
)

const (
Get = "GET"
Put = "PUT"
Post = "POST"
Delete = "DELETE"
Get = "GET"
Put = "PUT"
Post = "POST"
Delete = "DELETE"
Options = "OPTIONS"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pixiu/pkg/common/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func (rm *RouterCoordinator) OnAddRouter(r *model.Router) {
rm.rw.Lock()
defer rm.rw.Unlock()
if r.Match.Methods == nil {
r.Match.Methods = []string{constant.Get, constant.Put, constant.Delete, constant.Post}
r.Match.Methods = []string{constant.Get, constant.Put, constant.Delete, constant.Post, constant.Options}
}
isPrefix := r.Match.Prefix != ""
for _, method := range r.Match.Methods {
Expand Down
36 changes: 23 additions & 13 deletions pixiu/pkg/filter/cors/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/apache/dubbo-go-pixiu/pixiu/pkg/common/constant"
"github.com/apache/dubbo-go-pixiu/pixiu/pkg/common/extension/filter"
"github.com/apache/dubbo-go-pixiu/pixiu/pkg/context/http"
"github.com/apache/dubbo-go-pixiu/pkg/http/headers"
)

const (
Expand Down Expand Up @@ -79,41 +80,50 @@ func (factory *FilterFactory) PrepareFilterChain(ctx *http.HttpContext, chain fi
}

func (f *Filter) Decode(ctx *http.HttpContext) filter.FilterStatus {
f.handleCors(ctx)
return filter.Continue
}

func (f *Filter) handleCors(ctx *http.HttpContext) {
writer := ctx.Writer
c := f.cfg
if c == nil {
return
return filter.Continue
}
if ctx.GetHeader(headers.Origin) == "" {
// not a cors request
return filter.Continue
}

domains := c.AllowOrigin
if len(domains) != 0 {
for _, domain := range domains {
if ctx.Request.Host == domain || ctx.Request.URL.Host == domain ||
ctx.GetHeader("Host") == domain || ctx.GetHeader("host") == domain {
ctx.SourceResp.(*stdHttp.Response).Header.Add(constant.HeaderKeyAccessControlAllowOrigin, domain)
if domain == "*" || ctx.GetHeader("Origin") == domain {
writer.Header().Add(constant.HeaderKeyAccessControlAllowOrigin, domain)
continue
}
}
}

if c.AllowHeaders != "" {
ctx.SourceResp.(*stdHttp.Response).Header.Add(constant.HeaderKeyAccessControlExposeHeaders, c.AllowHeaders)
writer.Header().Add(constant.HeaderKeyAccessControlAllowHeaders, c.AllowHeaders)
}

if c.ExposeHeaders != "" {
writer.Header().Add(constant.HeaderKeyAccessControlExposeHeaders, c.ExposeHeaders)
}

if c.AllowMethods != "" {
ctx.SourceResp.(*stdHttp.Response).Header.Add(constant.HeaderKeyAccessControlAllowMethods, c.AllowMethods)
writer.Header().Add(constant.HeaderKeyAccessControlAllowMethods, c.AllowMethods)
}

if c.MaxAge != "" {
ctx.SourceResp.(*stdHttp.Response).Header.Add(constant.HeaderKeyAccessControlMaxAge, c.MaxAge)
writer.Header().Add(constant.HeaderKeyAccessControlMaxAge, c.MaxAge)
}

if c.AllowCredentials {
ctx.SourceResp.(*stdHttp.Response).Header.Add(constant.HeaderKeyAccessControlAllowCredentials, "true")
writer.Header().Add(constant.HeaderKeyAccessControlAllowCredentials, "true")
}
if ctx.Request.Method == stdHttp.MethodOptions {
ctx.SendLocalReply(stdHttp.StatusOK, nil)
return filter.Stop
}
return filter.Continue
}

func (factory *FilterFactory) Apply() error {
Expand Down
Loading