mirror of
https://github.com/alireza0/s-ui.git
synced 2026-10-24 04:43:21 +00:00
add auto early_data to link #1193
This commit is contained in:
parent
88b674388e
commit
0f4e29a95e
1 changed files with 9 additions and 0 deletions
|
|
@ -577,6 +577,15 @@ func getTransportParams(t interface{}) []LinkParam {
|
|||
}
|
||||
case "ws":
|
||||
if path, ok := trasport["path"].(string); ok {
|
||||
if maxED, ok := trasport["max_early_data"].(float64); ok && maxED > 0 {
|
||||
if edName, _ := trasport["early_data_header_name"].(string); edName == "Sec-WebSocket-Protocol" {
|
||||
sep := "?"
|
||||
if strings.Contains(path, "?") {
|
||||
sep = "&"
|
||||
}
|
||||
path = fmt.Sprintf("%s%sed=%d", path, sep, int(maxED))
|
||||
}
|
||||
}
|
||||
params = append(params, LinkParam{"path", path})
|
||||
}
|
||||
if headers, ok := trasport["headers"].(map[string]interface{}); ok {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue