mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-23 22:19:49 +00:00
SplitHTTP server: Add global CORS headers for browser dialer (#3830)
This commit is contained in:
parent
93cff1a576
commit
acbf36e21b
@ -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 New Issue
Block a user