mirror of
https://github.com/qtgolang/SunnyNet.git
synced 2026-08-30 22:11:29 -07:00
2026-06-08
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
package SunnyNet
|
||||
|
||||
import (
|
||||
"io"
|
||||
|
||||
"github.com/qtgolang/SunnyNet/src/http"
|
||||
)
|
||||
|
||||
@@ -21,3 +23,11 @@ func (s *Sunny) SetScriptCode(code string) string {
|
||||
func (s *Sunny) SetScriptPage(Page string) string {
|
||||
return "no"
|
||||
}
|
||||
|
||||
func allowOrigin(t string, w io.Writer) {
|
||||
w.Write([]byte(t + "\r\n"))
|
||||
w.Write([]byte("Access-Control-Allow-Origin: *\r\n"))
|
||||
w.Write([]byte("Access-Control-Allow-Methods: *\r\n"))
|
||||
w.Write([]byte("Access-Control-Allow-Headers: *\r\n"))
|
||||
w.Write([]byte("Access-Control-Expose-Headers: *\r\n"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user