Skip to content

Commit

Permalink
test: optimize adaptor unit_tests (#7)
Browse files Browse the repository at this point in the history
* test: optimize adaptor unit_tests

* style: gofumpt

* feat: add more adaptor test

* style: gofumpt

* del: delete useless codes

* style: gofumpt

* fix: remove extra request copy

---------

Co-authored-by: kinggo <[email protected]>
  • Loading branch information
ViolaPioggia and li-jin-gou committed Feb 16, 2024
1 parent a4a0c43 commit 4a8bbab
Show file tree
Hide file tree
Showing 4 changed files with 436 additions and 26 deletions.
2 changes: 1 addition & 1 deletion adaptor/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func NewHertzHTTPHandlerFunc(h http.HandlerFunc) app.HandlerFunc {
// Then manually convert net/http handlers to hertz handlers
func NewHertzHTTPHandler(h http.Handler) app.HandlerFunc {
return func(ctx context.Context, c *app.RequestContext) {
req, err := adaptor.GetCompatRequest(c.GetRequest())
req, err := adaptor.GetCompatRequest(&c.Request)
if err != nil {
hlog.CtxErrorf(ctx, "HERTZ: Get request error: %v", err)
c.String(http.StatusInternalServerError, consts.StatusMessage(http.StatusInternalServerError))
Expand Down
Loading

0 comments on commit 4a8bbab

Please sign in to comment.