Skip to content
This repository has been archived by the owner on Sep 24, 2023. It is now read-only.

Commit

Permalink
just send the access control headers from lambda (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimbrough88 authored Jun 19, 2021
1 parent 766b0a6 commit b122a4b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/handlers/api_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ import (
)

func apiResponse(status int, body interface{}, logger *zap.Logger) (*events.APIGatewayProxyResponse, error) {
resp := events.APIGatewayProxyResponse{Headers: map[string]string{"Content-Type": "application/json"}}
resp := events.APIGatewayProxyResponse{
Headers: map[string]string{
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Headers": "Authorization",
"Access-Control-Allow-Methods": "GET, POST, OPTIONS, DELETE",
"Content-Type": "application/json",
},
}
resp.StatusCode = status

stringBody, err := json.Marshal(body)
Expand Down

0 comments on commit b122a4b

Please sign in to comment.