diff options
author | Julien Dessaux | 2024-11-15 23:48:35 +0100 |
---|---|---|
committer | Julien Dessaux | 2024-11-15 23:48:35 +0100 |
commit | 478f42f8a9f070cef9e8c0b81dc7bd4c24bacde8 (patch) | |
tree | 2140b7b89ddf04ae3d9b149bf6d51061769178c5 /cmd/tfstate | |
parent | feat(tfstated): implement HTTP basic auth (diff) | |
download | tfstated-478f42f8a9f070cef9e8c0b81dc7bd4c24bacde8.tar.gz tfstated-478f42f8a9f070cef9e8c0b81dc7bd4c24bacde8.tar.bz2 tfstated-478f42f8a9f070cef9e8c0b81dc7bd4c24bacde8.zip |
chore(tfstated): use a struct{} as context.Context key
Diffstat (limited to '')
-rw-r--r-- | cmd/tfstated/post.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/tfstated/post.go b/cmd/tfstated/post.go index 718fed7..674eaba 100644 --- a/cmd/tfstated/post.go +++ b/cmd/tfstated/post.go @@ -25,7 +25,7 @@ func handlePost(db *database.DB) http.Handler { _ = errorResponse(w, http.StatusBadRequest, err) return } - account := r.Context().Value("account").(*model.Account) + account := r.Context().Value(model.AccountContextKey{}).(*model.Account) if idMismatch, err := db.SetState(r.URL.Path, account.Id, data, id); err != nil { if idMismatch { _ = errorResponse(w, http.StatusConflict, err) |