pbacsko commented on code in PR #757:
URL: https://github.com/apache/yunikorn-core/pull/757#discussion_r1530290596
##########
pkg/webservice/handlers.go:
##########
@@ -59,6 +60,7 @@ const (
GroupNameMissing = "Group name is missing"
ApplicationDoesNotExists = "Application not found"
NodeDoesNotExists = "Node not found"
+ UnsupportedCompType = "Compression type not support"
Review Comment:
nit: "not supported"
##########
pkg/webservice/handlers.go:
##########
@@ -1216,3 +1226,38 @@ func getStream(w http.ResponseWriter, r *http.Request) {
}
}
}
+
+func checkHeader(h http.Header, key string, value string) bool {
+ values := h.Values(key)
+ for _, v := range values {
+ if strings.Contains(v, value) {
+ return true
+ }
+ }
+ return false
+}
+
+func compress(w http.ResponseWriter, data any) {
+ response, err := json.Marshal(data)
+ if err != nil {
+ buildJSONErrorResponse(w, err.Error(),
http.StatusInternalServerError)
+ return
+ }
+
+ writer := gzip.NewWriter(w)
Review Comment:
close the writer with a defer call eg. (`defer writer.Close()` or similar)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]