I want to use Cookie along with the go-endpoints.
For this purpose , it is necessary to set the Access-Control-Allow-Credentials to Header.
However , do not know how to set the Allow-Credentials to Header in go-endpoints.
allowCookieAuth is , How do I to true doing ?
https://github.com/GoogleCloudPlatform/go-endpoints/search?utf8=%E2%9C%93&q=allowCookieAuth
because there is no http.ResponseWriter the go-endpoints handler , it is not possible to set the Http Header.
func (gs *GreetingService) List(c endpoints.Context, r *GreetingsListReq) (*GreetingsList, error) {
if r.Limit <= 0 {
r.Limit = 10
}
q := datastore.NewQuery("Greeting").Limit(r.Limit)
greets := make([]*Greeting, 0, r.Limit)
keys, err := q.GetAll(c, &greets)
if err != nil {
return nil, err
}
for i, k := range keys {
greets[i].Key = k
}
return &GreetingsList{greets}, nil
}
help me!