File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Needham Circle functions
22
3- The invocation-based Cloud Run functions behind
4- [ Needham Circle] ( https://github.com/needham-circle/needham-circle ) :
3+ The invocation-based Cloud Run functions behind https://needhamcircle.org .
54the static site calls these from the browser for everything dynamic. Each
65endpoint is its own deployed function; they all share this Go module and are
76selected at deploy time with ` --entry-point ` .
@@ -23,10 +22,7 @@ selected at deploy time with `--entry-point`.
2322- All three answer CORS preflights and stamp CORS headers. The allowlist is
2423 baked in, nothing to configure: deployed (Cloud Run sets ` K_SERVICE ` ) the
2524 functions accept https://needhamcircle.org (and www); running locally they
26- accept the local Jekyll site (localhost:4000). Browsers on any other
27- origin — including needham-circle.github.io — can't call them, so the
28- site must be served from the custom domain (or locally) for the dynamic
29- pages to work.
25+ accept the local Jekyll site (localhost:4000).
3026- ` SendContact ` also honors ` SMTP_ACCOUNT ` (default ` needhamcircle@gmail.com ` ).
3127
3228## Layout
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import (
1414 "net/http"
1515 "os"
1616
17- "github.com/needham-circle /functions"
17+ "github.com/needhamcircle /functions"
1818)
1919
2020func main () {
Original file line number Diff line number Diff line change 77)
88
99func TestApplyCORSEchoesAllowedOrigins (t * testing.T ) {
10- origins := []string {"https://needham-circle .github.io" , "http://localhost:4000" }
10+ origins := []string {"https://needhamcircle .github.io" , "http://localhost:4000" }
1111
1212 rec := httptest .NewRecorder ()
1313 request := httptest .NewRequest (http .MethodGet , "/" , nil )
@@ -29,7 +29,7 @@ func TestApplyCORSIgnoresUnlistedOrigins(t *testing.T) {
2929 request := httptest .NewRequest (http .MethodGet , "/" , nil )
3030 request .Header .Set ("Origin" , "https://evil.example" )
3131
32- applyCORS ([]string {"https://needham-circle .github.io" }, rec , request )
32+ applyCORS ([]string {"https://needhamcircle .github.io" }, rec , request )
3333
3434 if got := rec .Header ().Get ("Access-Control-Allow-Origin" ); got != "" {
3535 t .Errorf ("Allow-Origin = %q, want none for an unlisted origin" , got )
Original file line number Diff line number Diff line change 1- module github.com/needham-circle /functions
1+ module github.com/needhamcircle /functions
22
33go 1.25.0
44
You can’t perform that action at this time.
0 commit comments