(pluginName string, script string)
| 97 | } |
| 98 | |
| 99 | func (d *AssetServer) AddPluginScript(pluginName string, script string) { |
| 100 | if d.pluginScripts == nil { |
| 101 | d.pluginScripts = make(map[string]string) |
| 102 | } |
| 103 | pluginName = strings.ReplaceAll(pluginName, "/", "_") |
| 104 | pluginName = html.EscapeString(pluginName) |
| 105 | pluginScriptName := fmt.Sprintf("/plugin_%s_%d.js", pluginName, rand.Intn(100000)) |
| 106 | d.pluginScripts[pluginScriptName] = script |
| 107 | } |
| 108 | |
| 109 | func (d *AssetServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) { |
| 110 | if isWebSocket(req) { |
nothing calls this directly
no outgoing calls
no test coverage detected