Skip to content

Commit

Permalink
revert storage host change (used by old api < 3)
Browse files Browse the repository at this point in the history
as reported in #330
  • Loading branch information
ddvk committed Nov 22, 2024
1 parent 8dc4bcd commit 480f041
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions internal/app/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (

"github.com/ddvk/rmfakecloud/internal/app/hub"
"github.com/ddvk/rmfakecloud/internal/common"
"github.com/ddvk/rmfakecloud/internal/config"
"github.com/ddvk/rmfakecloud/internal/email"
"github.com/ddvk/rmfakecloud/internal/hwr"
"github.com/ddvk/rmfakecloud/internal/integrations"
Expand Down Expand Up @@ -624,11 +625,12 @@ func (app *App) updateStatus(c *gin.Context) {
}

func (app *App) locateService(c *gin.Context) {
// old api < 3 something
svc := c.Param("service")
log.Infof("Requested: %s\n", svc)
host := app.cfg.CloudHost
host := config.DefaultHost
if svc == "blob-storage" {
host = app.cfg.StorageURL
host = "https://" + config.DefaultHost
}
response := messages.HostResponse{Host: host, Status: "OK"}
c.JSON(http.StatusOK, response)
Expand Down
6 changes: 3 additions & 3 deletions internal/app/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func (app *App) registerRoutes(router *gin.Engine) {
router.GET("/discovery/v1/endpoints", func(c *gin.Context) {
c.JSON(http.StatusOK, messages.EndpointsResponse{
Notifications: app.cfg.CloudHost,
Webapp: app.cfg.CloudHost,
// TODO: investigage usage
Webapp: app.cfg.CloudHost,
// TODO: investigate usage
// MQTT: app.cfg.CloudHost,
})
})
Expand All @@ -34,7 +34,7 @@ func (app *App) registerRoutes(router *gin.Engine) {
// in 3.15 only https without a port is used by the client
router.GET("/discovery/v1/webapp", func(c *gin.Context) {
c.JSON(http.StatusOK, messages.HostResponse{
Host: app.cfg.CloudHost,
Host: app.cfg.CloudHost,
Status: "OK",
})
})
Expand Down

0 comments on commit 480f041

Please sign in to comment.