Skip to content

Commit 74a2729

Browse files
committed
feat: get host from a request
Signed-off-by: Ales Verbic <[email protected]>
1 parent b06e56b commit 74a2729

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

output/push/api_routes.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ func (p *PushOutput) RegisterRoutes() {
2929
apiInstance := api.GetInstance()
3030
var apiEndpoint string
3131
if apiInstance.ApiGroup != nil {
32-
apiEndpoint = apiInstance.Host + apiInstance.ApiGroup.BasePath() + "/fcm"
32+
apiEndpoint = apiInstance.ApiGroup.BasePath() + "/fcm"
3333
} else {
34-
apiEndpoint = apiInstance.Host + "/fcm"
34+
apiEndpoint = "/fcm"
3535
}
3636

3737
apiInstance.AddRoute("POST", "/fcm", storeFCMToken)

output/push/qr_generator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ type QRValue struct {
1515

1616
func generateQRPage(apiEndpoint string) gin.HandlerFunc {
1717
return func(c *gin.Context) {
18+
apiEndpoint = c.Request.Host + apiEndpoint
1819
qrValue, err := json.Marshal(QRValue{
1920
ApiEndpoint: apiEndpoint,
2021
})

0 commit comments

Comments
 (0)