私は、negroniミドルウェアでgolang apiバックエンドを持っています。 私はすでにnegroniのCORSハンドラを実装していますので、私のAPIはクロスオリジンのリソース共有を許可するべきです。 // allow OPTIONS method of CORS requests
c := cors.New(cors.Options{
AllowedOrigins: []st
にミドルウェアからコンテキストを渡します。ここでは、私のコードの下のバージョンを取り除いた: // Session Middleware function
func sessMid(w http.ResponseWriter, r *http.Request, next
http.HandlerFunc) {
ctx := r.Context()
s, _ := store