Open flaviotsf opened 4 years ago
I'm interested in this as well. Seems pretty easy to fix and I can provide a PR but the authors doesn't seem to maintain this repository anymore so I won't spend time on this right now.
This is how you get what main page suffix and not found page is set to:
bucketAttr, _ := client.Bucket(c.BucketName).Attrs(context.Background())
fmt.Println(bucketAttr.Website.MainPageSuffix)
fmt.Println(bucketAttr.Website.NotFoundPage)
If the given r.URL.Path
404s, we should try filepath.Join(r.URL.Path, bucketAttr.Website.MainPageSuffix)
. Might need some tweaking to support both trailing slashes and not.
I have a private GCS bucket that is only accessible to staff members - we do that using the GCS-Helper proxy that is mapped to an internal hostname (GCS Proxy deployed to K8s).
Everything works great for the most part - one thing that does not is that even though I've set the GCS web config via:
gsutil web set -m index.html -e index.html gs://www.example.com
Requests to a folder like "/a" do not forward requests to "/a/index.html" and I just get a:
Has anyone figured out how to get GCS-Helper working with default documents?