Skip to content

Commit 39b5aef

Browse files
committed
Check for document existence using HEAD
This should reduce network traffic of `hiser import`, since we only care for that method's status.
1 parent 3716912 commit 39b5aef

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

client/document.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (c *Client) AddPage(u, title, text string) error {
4444
}
4545

4646
func (c *Client) DocumentExists(u string) (bool, error) {
47-
req, err := c.newRequest("GET", "/api/document?url="+url.QueryEscape(u), nil)
47+
req, err := c.newRequest("HEAD", "/api/document?url="+url.QueryEscape(u), nil)
4848
if err != nil {
4949
return false, err
5050
}

0 commit comments

Comments
 (0)