我嘗試使用記錄的方式來限制對通過登錄方式標記為靜態的 url 的訪問:app.yaml 文件中的必需規則。我的目的是通過 xmlhttprequests 訪問由 go 編程語言處理的腳本 url,但是在用戶加載文件 dist/index.html 之前驗證用戶的第一步失敗。令我驚訝的是,沒有提示用戶登錄,而是從靜態文件夾中接收 dist/index.html 文件和它要求的所有其他文件,就好像沒有限制規則存在一樣。這是我的 app.yaml 文件:application: helloworldversion: 1runtime: goapi_version: go1handlers:- url: / static_files: dist/index.html upload: dist/index.html secure: always login: required - this is what fails as far as I'm concerned- url: /(.*\.(txt|html|json|png|js|log|md|css|ico)) static_files: dist/\1 upload: dist/(.*\.(txt|html|json|png|js|log|md|css|ico)) secure: always login: required- url: /.* script: _go_app secure: always login: required我上傳到 appengine 的文件夾如下所示:app.yamlindex.yamlxhr_responses.go - this is the intended future non static AJAX partdist/ index.html loads of other stuff that is static
- 2 回答
- 0 關注
- 195 瀏覽
添加回答
舉報
0/150
提交
取消