alipay/container-observability-service

Bug: lunettesdi cors error

Closed this issue · 4 comments

Bug: lunettesdi cors error

@linuzb cloud you please give information related to the error codes?

if err := json.NewEncoder(w).Encode(respObj); err != nil {
log.Printf("json enc: %+v", err)
}
// set header
w.Header().Set("Content-Type", "application/json;charset=UTF-8")
// set cors header
corsHeader(r, w)

When json.NewEncoder(w).Encode(respObj) is executed, set cors header
will never be executed. Therefore, it cann't be implemented across requests.We should put set header before json Encode.

/assigned

/assign