diff options
author | Mike Crute <mike@crute.us> | 2021-11-24 21:58:09 -0800 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2021-11-24 22:11:12 -0800 |
commit | e5629fb163c7cf303438afc5be6075299cfc6071 (patch) | |
tree | 0f835aa20df3e93d93358810566ab9986db35eaa /app/controllers/api_user.go | |
parent | 09fa11a1dad5301e8e0aeb069fc1d11312b4a1c5 (diff) | |
download | cloud-identity-broker-e5629fb163c7cf303438afc5be6075299cfc6071.tar.bz2 cloud-identity-broker-e5629fb163c7cf303438afc5be6075299cfc6071.tar.xz cloud-identity-broker-e5629fb163c7cf303438afc5be6075299cfc6071.zip |
Extract URL building logic
Diffstat (limited to 'app/controllers/api_user.go')
-rw-r--r-- | app/controllers/api_user.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/api_user.go b/app/controllers/api_user.go index e55d88d..b024ffd 100644 --- a/app/controllers/api_user.go +++ b/app/controllers/api_user.go | |||
@@ -4,6 +4,7 @@ import ( | |||
4 | "context" | 4 | "context" |
5 | "net/http" | 5 | "net/http" |
6 | 6 | ||
7 | "code.crute.us/mcrute/cloud-identity-broker/app" | ||
7 | "code.crute.us/mcrute/cloud-identity-broker/app/models" | 8 | "code.crute.us/mcrute/cloud-identity-broker/app/models" |
8 | 9 | ||
9 | glecho "code.crute.us/mcrute/golib/echo" | 10 | glecho "code.crute.us/mcrute/golib/echo" |
@@ -152,7 +153,7 @@ func (h *APIUserHandler) HandlePost(c echo.Context) error { | |||
152 | return echo.ErrInternalServerError | 153 | return echo.ErrInternalServerError |
153 | } | 154 | } |
154 | 155 | ||
155 | c.Response().Header().Add("Location", glecho.URLFor(c, "/api/user", in.Username).String()) | 156 | c.Response().Header().Add("Location", app.AppURL{}.User(c, &in.Username)) |
156 | 157 | ||
157 | return c.String(http.StatusCreated, "") | 158 | return c.String(http.StatusCreated, "") |
158 | } | 159 | } |