limit cors only get, head, options
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -31,3 +31,4 @@ assets_vfsdata.go
|
|||||||
*.swp
|
*.swp
|
||||||
|
|
||||||
dist/
|
dist/
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Tested with go-1.16
|
|||||||
1. [x] Apple ipa auto generate .plist file, qrcode can be recognized by iphone (Require https)
|
1. [x] Apple ipa auto generate .plist file, qrcode can be recognized by iphone (Require https)
|
||||||
1. [x] Plist proxy
|
1. [x] Plist proxy
|
||||||
1. [ ] Download count statistics
|
1. [ ] Download count statistics
|
||||||
1. [x] CORS enabled
|
1. [x] CORS enabled (AllowMethods: GET, HEAD, OPTIONS)
|
||||||
1. [ ] Offline download
|
1. [ ] Offline download
|
||||||
1. [ ] Code file preview
|
1. [ ] Code file preview
|
||||||
1. [ ] Edit file support
|
1. [ ] Edit file support
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -207,7 +207,7 @@ func main() {
|
|||||||
|
|
||||||
// CORS
|
// CORS
|
||||||
if gcfg.Cors {
|
if gcfg.Cors {
|
||||||
hdlr = handlers.CORS()(hdlr)
|
hdlr = handlers.CORS(handlers.AllowedMethods([]string{"GET", "HEAD", "OPTIONS"}))(hdlr)
|
||||||
}
|
}
|
||||||
if gcfg.XHeaders {
|
if gcfg.XHeaders {
|
||||||
hdlr = handlers.ProxyHeaders(hdlr)
|
hdlr = handlers.ProxyHeaders(hdlr)
|
||||||
|
|||||||
1
testdata/filetypes/script.js
vendored
Normal file
1
testdata/filetypes/script.js
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
document.write("Hello world!")
|
||||||
Reference in New Issue
Block a user