aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-12-12 14:08:13 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-12-12 14:08:13 +0100
commite59ab03dcd92d068081800d57cafc3053c1cdbc6 (patch)
treee873d032e9da6d9943608114cb82c78a8be2942c /client.go
parent5b583d8c6604bee2ac028b154947945c6df4ddab (diff)
Location is set only on 201
Diffstat (limited to 'client.go')
-rw-r--r--client.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.go b/client.go
index f966ec1..0422a39 100644
--- a/client.go
+++ b/client.go
@@ -92,7 +92,9 @@ func (c *Client) post(url string, s Signer, v interface{}) (*http.Response, erro
c.nonce <- replyNonce(resp)
c.Link = links(resp)
- c.Location = location(resp)
+ if resp.StatusCode == http.StatusCreated {
+ c.Location = location(resp)
+ }
return resp, nil
}