We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
arduino
Learn more about funding links in repositories.
Report abuse
1 parent db13181 commit e1222c4Copy full SHA for e1222c4
info.go
@@ -1,17 +1,23 @@
1
package main
2
3
import (
4
+ "strings"
5
+
6
"github.com/gin-gonic/gin"
7
"go.bug.st/serial.v1"
8
)
9
10
func infoHandler(c *gin.Context) {
11
+ host := c.Request.Host
12
+ parts := strings.Split(host, ":")
13
+ host = parts[0]
14
15
c.JSON(200, gin.H{
16
"version": version,
- "http": "http://" + c.Request.Host + ":" + port,
- "https": "https://" + c.Request.Host + ":" + portSSL,
- "ws": "ws://" + c.Request.Host + ":" + port,
- "wss": "wss://" + c.Request.Host + ":" + portSSL,
17
+ "http": "http://" + host + port,
18
+ "https": "https://" + host + portSSL,
19
+ "ws": "ws://" + host + port,
20
+ "wss": "wss://" + host + portSSL,
21
})
22
}
23
0 commit comments