implement review feedback and add changelog

This commit is contained in:
David Christofas committed 2020-03-18 15:05:09 +01:00
1 parent 852133fa46
commit 9d28990562
4 files changed
+13 -6

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
Enhancement: implement preview API
Added the API endpoint for file previews.
https://github.com/owncloud/ocis-webdav/pull/13
+6 -4
View File
@@ -11,8 +11,10 @@ import (
)
const (
// DefaultSize defines the default width and height of a thumbnail
DefaultSize = 32
// DefaultWidth defines the default width of a thumbnail
DefaultWidth = 32
// DefaultHeight defines the default height of a thumbnail
DefaultHeight = 32
)
// Request combines all parameters provided when requesting a thumbnail
@@ -31,11 +33,11 @@ func NewRequest(r *http.Request) (Request, error) {
query := r.URL.Query()
width, err := strconv.Atoi(query.Get("x"))
if err != nil {
width = DefaultSize
width = DefaultWidth
}
height, err := strconv.Atoi(query.Get("y"))
if err != nil {
height = DefaultSize
height = DefaultHeight
}
etag := query.Get("c")
+1 -1
View File
@@ -24,7 +24,7 @@ func (i instrument) ServeHTTP(w http.ResponseWriter, r *http.Request) {
i.next.ServeHTTP(w, r)
}
// Dummy implements the Service interface.
// Thumbnail implements the Service interface.
func (i instrument) Thumbnail(w http.ResponseWriter, r *http.Request) {
i.next.Thumbnail(w, r)
}
+1 -1
View File
@@ -20,7 +20,7 @@ func (t tracing) ServeHTTP(w http.ResponseWriter, r *http.Request) {
t.next.ServeHTTP(w, r)
}
// Dummy implements the Service interface.
// Thumbnail implements the Service interface.
func (t tracing) Thumbnail(w http.ResponseWriter, r *http.Request) {
t.next.Thumbnail(w, r)
}