--- a/v1/books/book.go Thu Jan 21 11:42:48 2021 -0600
+++ b/v1/books/book.go Fri Jan 22 14:55:09 2021 -0600
@@ -14,10 +14,13 @@
book, err := db.FindBook(bookID)
- log.Errorf("failed to find book %q", bookID)
c.AbortWithStatus(http.StatusNotFound)
- c.JSON(http.StatusOK, book)
+ if c.Request.Method == http.MethodHead { + c.Status(http.StatusOK) + c.JSON(http.StatusOK, book) --- a/v1/books/routes.go Thu Jan 21 11:42:48 2021 -0600
+++ b/v1/books/routes.go Fri Jan 22 14:55:09 2021 -0600
@@ -10,6 +10,7 @@
books := router.Group("/books")
books.GET("/:id", getBook)
+ books.HEAD("/:id", getBook) authed := books.Group("", access.Middleware())