From e59ab03dcd92d068081800d57cafc3053c1cdbc6 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 12 Dec 2015 14:08:13 +0100 Subject: Location is set only on 201 --- client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'client.go') 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 } -- cgit v1.2.3