Skip to content

Commit

Permalink
feat: stream validate
Browse files Browse the repository at this point in the history
  • Loading branch information
LidolLxf committed Feb 28, 2025
1 parent eca9639 commit 980aad5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bcs-services/bcs-monitor/pkg/rest/rest.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,12 @@ func Stream[In any](handler StreamHandlerFunc[In]) func(w http.ResponseWriter, r
_ = render.Render(w, r, AbortWithJSONError(restContext, err))
return
}
err = Struct(r.Context(), in)
if err != nil {
blog.Errorf("valid request param failed, err: %s", err)
_ = render.Render(w, r, AbortWithJSONError(restContext, err))
return
}
svr := &streamingServer{
ResponseWriter: w,
ResponseController: http.NewResponseController(w),
Expand Down

0 comments on commit 980aad5

Please sign in to comment.