summaryrefslogtreecommitdiffhomepage
path: root/website/cmd/server/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'website/cmd/server/main.go')
-rw-r--r--website/cmd/server/main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/website/cmd/server/main.go b/website/cmd/server/main.go
index 18cd525d2..7c8bc9bfa 100644
--- a/website/cmd/server/main.go
+++ b/website/cmd/server/main.go
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// Server is the main gvisor.dev binary.
package main
import (
@@ -65,7 +66,7 @@ var prefixHelpers = map[string]string{
}
var (
- validId = regexp.MustCompile(`^[A-Za-z0-9-]*/?$`)
+ validID = regexp.MustCompile(`^[A-Za-z0-9-]*/?$`)
goGetHTML5 = `<!doctype html><html><head><meta charset=utf-8>
<meta name="go-import" content="gvisor.dev/gvisor git https://github.com/google/gvisor">
<meta name="go-import" content="gvisor.dev/website git https://github.com/google/gvisor-website">
@@ -123,7 +124,7 @@ func hostRedirectHandler(h http.Handler) http.Handler {
return
}
- if *projectId != "" && r.Host == *projectId+".appspot.com" && *customHost != "" {
+ if *projectID != "" && r.Host == *projectID+".appspot.com" && *customHost != "" {
// Redirect to the custom domain.
r.URL.Scheme = "https" // Assume https.
r.URL.Host = *customHost
@@ -143,7 +144,7 @@ func prefixRedirectHandler(prefix, baseURL string) http.Handler {
return
}
id := r.URL.Path[len(prefix):]
- if !validId.MatchString(id) {
+ if !validID.MatchString(id) {
http.Error(w, "Not found", http.StatusNotFound)
return
}
@@ -195,7 +196,7 @@ var (
staticDir = flag.String("static-dir", envFlagString("STATIC_DIR", "_site"), "static files directory")
// Uses the standard GOOGLE_CLOUD_PROJECT environment variable set by App Engine.
- projectId = flag.String("project-id", envFlagString("GOOGLE_CLOUD_PROJECT", ""), "The App Engine project ID.")
+ projectID = flag.String("project-id", envFlagString("GOOGLE_CLOUD_PROJECT", ""), "The App Engine project ID.")
customHost = flag.String("custom-domain", envFlagString("CUSTOM_DOMAIN", "gvisor.dev"), "The application's custom domain.")
)