d18312ecde
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
80 lines
2.4 KiB
Go
80 lines
2.4 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package operations
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
)
|
|
|
|
// OptionsAuthOKCode is the HTTP code returned for type OptionsAuthOK
|
|
const OptionsAuthOKCode int = 200
|
|
|
|
/*OptionsAuthOK CORS
|
|
|
|
swagger:response optionsAuthOK
|
|
*/
|
|
type OptionsAuthOK struct {
|
|
/*
|
|
|
|
*/
|
|
AccessControlAllowHeaders string `json:"Access-Control-Allow-Headers"`
|
|
/*
|
|
|
|
*/
|
|
AccessControlAllowOrigin string `json:"Access-Control-Allow-Origin"`
|
|
}
|
|
|
|
// NewOptionsAuthOK creates OptionsAuthOK with default headers values
|
|
func NewOptionsAuthOK() *OptionsAuthOK {
|
|
|
|
return &OptionsAuthOK{}
|
|
}
|
|
|
|
// WithAccessControlAllowHeaders adds the accessControlAllowHeaders to the options auth o k response
|
|
func (o *OptionsAuthOK) WithAccessControlAllowHeaders(accessControlAllowHeaders string) *OptionsAuthOK {
|
|
o.AccessControlAllowHeaders = accessControlAllowHeaders
|
|
return o
|
|
}
|
|
|
|
// SetAccessControlAllowHeaders sets the accessControlAllowHeaders to the options auth o k response
|
|
func (o *OptionsAuthOK) SetAccessControlAllowHeaders(accessControlAllowHeaders string) {
|
|
o.AccessControlAllowHeaders = accessControlAllowHeaders
|
|
}
|
|
|
|
// WithAccessControlAllowOrigin adds the accessControlAllowOrigin to the options auth o k response
|
|
func (o *OptionsAuthOK) WithAccessControlAllowOrigin(accessControlAllowOrigin string) *OptionsAuthOK {
|
|
o.AccessControlAllowOrigin = accessControlAllowOrigin
|
|
return o
|
|
}
|
|
|
|
// SetAccessControlAllowOrigin sets the accessControlAllowOrigin to the options auth o k response
|
|
func (o *OptionsAuthOK) SetAccessControlAllowOrigin(accessControlAllowOrigin string) {
|
|
o.AccessControlAllowOrigin = accessControlAllowOrigin
|
|
}
|
|
|
|
// WriteResponse to the client
|
|
func (o *OptionsAuthOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
|
|
|
|
// response header Access-Control-Allow-Headers
|
|
|
|
accessControlAllowHeaders := o.AccessControlAllowHeaders
|
|
if accessControlAllowHeaders != "" {
|
|
rw.Header().Set("Access-Control-Allow-Headers", accessControlAllowHeaders)
|
|
}
|
|
|
|
// response header Access-Control-Allow-Origin
|
|
|
|
accessControlAllowOrigin := o.AccessControlAllowOrigin
|
|
if accessControlAllowOrigin != "" {
|
|
rw.Header().Set("Access-Control-Allow-Origin", accessControlAllowOrigin)
|
|
}
|
|
|
|
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
|
|
|
|
rw.WriteHeader(200)
|
|
}
|