Skip to content

Commit

Permalink
Fix REQUEST_URL to reflect host and port of a client (#580)
Browse files Browse the repository at this point in the history
Fixes: #578
  • Loading branch information
denismakogon authored and treeder committed Mar 14, 2017
1 parent 45831bc commit 6a8b995
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/server/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,11 @@ func (s *Server) serve(ctx context.Context, c *gin.Context, appName string, foun
envVars := map[string]string{
"METHOD": c.Request.Method,
"ROUTE": found.Path,
"REQUEST_URL": c.Request.URL.String(),
"REQUEST_URL": fmt.Sprintf("%v//%v%v", func() string {
if c.Request.TLS == nil {
return "http"
}
return "https"}(), c.Request.Host, c.Request.URL.String()),
}

// app config
Expand Down

0 comments on commit 6a8b995

Please sign in to comment.