forked from loafle/openapi-generator-original
Allow to specify response headers (needed for redirecting clients) (#9170)
* Allow to specify response headers (needed for redirecting clients) (#8148) Co-authored-by: Bernardo Pastorelli <13519917+randomswdev@users.noreply.github.com> * add addResponseHeaders option * enable addResponseHeaders * fix comma Co-authored-by: randomswdev <randomswdev@users.noreply.github.com> Co-authored-by: Bernardo Pastorelli <13519917+randomswdev@users.noreply.github.com>
This commit is contained in:
@@ -56,7 +56,7 @@ func NewRouter(routers ...Router) *mux.Router {
|
||||
}
|
||||
|
||||
// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
|
||||
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error {
|
||||
func EncodeJSONResponse(i interface{}, status *int, headers map[string][]string, w http.ResponseWriter) error {
|
||||
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
|
||||
if status != nil {
|
||||
w.WriteHeader(*status)
|
||||
|
||||
Reference in New Issue
Block a user