mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 03:13:32 +02:00
SplitHTTP server: Add global CORS headers for browser dialer (#3830)
This commit is contained in:
parent
93cff1a576
commit
acbf36e21b
1 changed files with 3 additions and 0 deletions
|
@ -55,6 +55,9 @@ func (c *Config) GetRequestHeader() http.Header {
|
|||
}
|
||||
|
||||
func (c *Config) WriteResponseHeader(writer http.ResponseWriter) {
|
||||
// CORS headers for the browser dialer
|
||||
writer.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
writer.Header().Set("Access-Control-Allow-Methods", "GET, POST")
|
||||
paddingLen := c.GetNormalizedXPaddingBytes().roll()
|
||||
if paddingLen > 0 {
|
||||
writer.Header().Set("X-Padding", strings.Repeat("0", int(paddingLen)))
|
||||
|
|
Loading…
Reference in a new issue