Skip to content

Commit

Permalink
feature: #216 Added conditional for BasePath (this affects tests mainly)
Browse files Browse the repository at this point in the history
  • Loading branch information
akeemphilbert committed Aug 19, 2022
1 parent 36f8979 commit 0374e8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion controllers/rest/middleware_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ func Context(api Container, projection projections.Projection, commandDispatcher
cc = context.WithValue(cc, weosContext.ACCOUNT_ID, accountID)
}
//set the basePath in context so that urls can be generated correctly #216
cc = context.WithValue(cc, "BASE_PATH", api.GetWeOSConfig().BasePath)
if api.GetWeOSConfig() != nil {
cc = context.WithValue(cc, "BASE_PATH", api.GetWeOSConfig().BasePath)
}
//use the path information to get the parameter values
contextValues, err := parseParams(c, path.Parameters, entityFactory)
//add parameter values to the context
Expand Down

0 comments on commit 0374e8a

Please sign in to comment.