Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add specific Allow-Origins header #157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cdk/rocketnotes.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func RocketnotesStack(scope constructs.Construct, id string, props *RocketnotesS
httpApi := awscdkapigatewayv2alpha.NewHttpApi(stack, jsii.String("MyHttpApi"), &awscdkapigatewayv2alpha.HttpApiProps{
ApiName: jsii.String("MyHttpApi"),
CorsPreflight: &awscdkapigatewayv2alpha.CorsPreflightOptions{
// TODO - change this to the actual allowed origins
AllowOrigins: jsii.Strings("*"),
AllowHeaders: jsii.Strings("*"),
AllowMethods: &[]awscdkapigatewayv2alpha.CorsHttpMethod{
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/archive-zettel-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/delete-zettel-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/get-document-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/get-document-tree-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/get-shared-document-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/get-user-config-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/get-zettelkasten-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/hello-world-handler/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-document-handler/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-document-public-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-document-title-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-document-tree-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-user-config-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-vector-embeddings-handler/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def handler(event, context):
"statusCode": 200,
"headers": {
"Content-Type": "application/json",
# TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*",
},
"body": json.dumps("Success"),
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/save-zettel-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
}, nil
Expand Down
1 change: 1 addition & 0 deletions lambda-handler/search-document-handler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ func handleRequest(ctx context.Context, request events.APIGatewayProxyRequest) (
return events.APIGatewayProxyResponse{
StatusCode: 200,
Headers: map[string]string{
// TODO - change this to the actual allowed origins
"Access-Control-Allow-Origin": "*", // Required for CORS support to work locally
},
Body: string(b),
Expand Down
1 change: 1 addition & 0 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Globals:
Cors:
AllowMethods: "'GET,POST,DELETE,OPTIONS'"
AllowHeaders: "'content-type'"
// TODO - change this to the actual allowed origins
AllowOrigin: "'*'"
AllowCredentials: "'*'"

Expand Down
Loading