Skip to content

Commit

Permalink
clean-up todos
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin van Loo committed Aug 15, 2023
1 parent d2dfb8d commit 0515a1e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
3 changes: 1 addition & 2 deletions endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func init() {
}

func serve(w http.ResponseWriter, r *http.Request) error {
path := r.URL.Path // @todo: is this already cleaned?
path := r.URL.Path
isFolder := path[len(path)-1] == '/'

switch r.Method {
Expand Down Expand Up @@ -288,7 +288,6 @@ func PutDocument(w http.ResponseWriter, r *http.Request) error {

mime := r.Header.Get("Content-Type")

// @todo: merge Create and Update into one function?
if found {
fd, err := FS.Create(n.sname)
if err != nil {
Expand Down
20 changes: 0 additions & 20 deletions endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,11 +685,6 @@ func TestPutDocumentUpdatesAncestorETags(t *testing.T) {
if e := r.Header.Get("ETag"); e != testDocumentDirETag1 {
t.Errorf("got: `%s', want: `%s'", e, testDocumentDirETag1)
}
// @todo: maybe we want to validate this as well?
//bs, err := io.ReadAll(r.Body)
//if err != nil {
// t.Error(err)
//}
}

// Get root folder ETag
Expand All @@ -707,11 +702,6 @@ func TestPutDocumentUpdatesAncestorETags(t *testing.T) {
if e := r.Header.Get("ETag"); e != testRootETag1 {
t.Errorf("got: `%s', want: `%s'", e, testRootETag1)
}
// @todo: maybe we want to validate this as well?
//bs, err := io.ReadAll(r.Body)
//if err != nil {
// t.Error(err)
//}
}

// PUT second document
Expand Down Expand Up @@ -748,11 +738,6 @@ func TestPutDocumentUpdatesAncestorETags(t *testing.T) {
if e := r.Header.Get("ETag"); e != testDocumentDirETag2 {
t.Errorf("got: `%s', want: `%s'", e, testDocumentDirETag2)
}
// @todo: maybe we want to validate this as well?
//bs, err := io.ReadAll(r.Body)
//if err != nil {
// t.Error(err)
//}
}

// Get root folder ETag
Expand All @@ -770,11 +755,6 @@ func TestPutDocumentUpdatesAncestorETags(t *testing.T) {
if e := r.Header.Get("ETag"); e != testRootETag2 {
t.Errorf("got: `%s', want: `%s'", e, testRootETag2)
}
// @todo: maybe we want to validate this as well?
//bs, err := io.ReadAll(r.Body)
//if err != nil {
// t.Error(err)
//}
}
}

Expand Down

0 comments on commit 0515a1e

Please sign in to comment.