Skip to content

Commit

Permalink
limit cors only get, head, options
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Dec 19, 2023
1 parent 80c9e79 commit ea72724
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ assets_vfsdata.go
*.swp

dist/
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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] Plist proxy
1. [ ] Download count statistics
1. [x] CORS enabled
1. [x] CORS enabled (AllowMethods: GET, HEAD, OPTIONS)
1. [ ] Offline download
1. [ ] Code file preview
1. [ ] Edit file support
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func main() {

// CORS
if gcfg.Cors {
hdlr = handlers.CORS()(hdlr)
hdlr = handlers.CORS(handlers.AllowedMethods([]string{"GET", "HEAD", "OPTIONS"}))(hdlr)
}
if gcfg.XHeaders {
hdlr = handlers.ProxyHeaders(hdlr)
Expand Down
1 change: 1 addition & 0 deletions testdata/filetypes/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
document.write("Hello world!")

0 comments on commit ea72724

Please sign in to comment.