aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2020-10-30 18:15:36 -0400
committerDmitri Shuralyov <dmitshur@golang.org>2020-11-06 23:45:32 +0000
commit59417492f03e0d55e544815ff163973cef919f67 (patch)
treef19b5ba03b7d969dea1cd3978daa25baa4953977
parent6f9d4ff994b136951d420708cd231da267653086 (diff)
downloadgolang-id-tour-59417492f03e0d55e544815ff163973cef919f67.tar.xz
tour: redirect HTTP traffic to HTTPS
Set secure to always on all handlers so that HTTP traffic is redirected to an HTTPS URL with the same path. References: • https://cloud.google.com/appengine/docs/standard/go/application-security#https_requests • https://cloud.google.com/appengine/docs/standard/go/config/appref#handlers_secure For golang/go#42281. Change-Id: Ic03e01d5858e1e5b8ae1b523ab34d970e1403ce0 Reviewed-on: https://go-review.googlesource.com/c/tour/+/266817 Trust: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
-rw-r--r--app.yaml9
1 files changed, 8 insertions, 1 deletions
diff --git a/app.yaml b/app.yaml
index 5ba09d0..aab2f02 100644
--- a/app.yaml
+++ b/app.yaml
@@ -15,9 +15,10 @@ env_variables:
default_expiration: "7d"
+handlers:
+
# Keep these static file handlers in sync with local.go.
# They're here for improved latency across global regions.
-handlers:
- url: /favicon.ico
static_files: static/img/favicon.ico
upload: static/img/favicon.ico
@@ -28,3 +29,9 @@ handlers:
- url: /static
static_dir: static
secure: always
+
+# This is here to redirect all HTTP traffic to an HTTPS URL
+# with the same path.
+- url: /.*
+ script: auto
+ secure: always