mirror of https://github.com/JustKato/FreePad.git
* Hopefully a fix
This commit is contained in:
parent
5a8ccf20a8
commit
177ab62720
|
@ -4,7 +4,6 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/JustKato/FreePad/lib/objects"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
@ -34,13 +33,14 @@ func BindSocket(router *gin.RouterGroup) {
|
|||
// Get the name of the pad to assign to this socket
|
||||
padName := ctx.Param("pad")
|
||||
// Upgrade the socket connection
|
||||
webSocketUpgrade(ctx.Writer, ctx.Request, padName)
|
||||
webSocketUpgrade(ctx, padName)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func webSocketUpgrade(w http.ResponseWriter, r *http.Request, padName string) {
|
||||
conn, err := wsUpgrader.Upgrade(w, r, nil)
|
||||
func webSocketUpgrade(ctx *gin.Context, padName string) {
|
||||
|
||||
conn, err := wsUpgrader.Upgrade(ctx.Writer, ctx.Request, ctx.Request.Header)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to set websocket upgrade: %v\n", err)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue