Skip to content

Commit

Permalink
Increase Upload-Draft-Interop-Version
Browse files Browse the repository at this point in the history
  • Loading branch information
Acconut committed Nov 4, 2023
1 parent cc296d7 commit a2d0628
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions pkg/handler/head_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ func TestHead(t *testing.T) {
Method: "HEAD",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
},
Code: http.StatusNoContent,
ResHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Complete": "?0",
"Upload-Offset": "5",
},
Expand Down Expand Up @@ -202,11 +202,11 @@ func TestHead(t *testing.T) {
Method: "HEAD",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
},
Code: http.StatusNoContent,
ResHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Complete": "?1",
"Upload-Offset": "10",
},
Expand Down Expand Up @@ -235,11 +235,11 @@ func TestHead(t *testing.T) {
Method: "HEAD",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
},
Code: http.StatusNoContent,
ResHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Complete": "?0",
"Upload-Offset": "5",
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/handler/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ func TestPatch(t *testing.T) {
Method: "PATCH",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Offset": "5",
"Upload-Complete": "?1",
},
Expand Down Expand Up @@ -882,7 +882,7 @@ func TestPatch(t *testing.T) {
Method: "PATCH",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Offset": "5",
"Upload-Complete": "?1",
},
Expand Down Expand Up @@ -918,7 +918,7 @@ func TestPatch(t *testing.T) {
Method: "PATCH",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Offset": "5",
"Upload-Complete": "?0",
},
Expand Down Expand Up @@ -954,7 +954,7 @@ func TestPatch(t *testing.T) {
Method: "PATCH",
URL: "yes",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Offset": "5",
"Upload-Complete": "?0",
},
Expand Down
12 changes: 6 additions & 6 deletions pkg/handler/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -591,15 +591,15 @@ func TestPost(t *testing.T) {
res := (&httpTest{
Method: "POST",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Complete": "?1",
"Content-Type": "text/plain; charset=utf-8",
"Content-Disposition": "attachment; filename=hello.txt",
},
ReqBody: strings.NewReader("hello world"),
Code: http.StatusCreated,
ResHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Location": "http://tus.io/files/foo",
"Upload-Offset": "11",
},
Expand All @@ -610,7 +610,7 @@ func TestPost(t *testing.T) {
{
Code: 104,
Header: http.Header{
"Upload-Draft-Interop-Version": []string{"3"},
"Upload-Draft-Interop-Version": []string{"4"},
"Location": []string{"http://tus.io/files/foo"},
"X-Content-Type-Options": []string{"nosniff"},
},
Expand Down Expand Up @@ -654,13 +654,13 @@ func TestPost(t *testing.T) {
res := (&httpTest{
Method: "POST",
ReqHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Upload-Complete": "?0",
},
ReqBody: strings.NewReader("hello world"),
Code: http.StatusCreated,
ResHeader: map[string]string{
"Upload-Draft-Interop-Version": "3",
"Upload-Draft-Interop-Version": "4",
"Location": "http://tus.io/files/foo",
"Upload-Offset": "11",
},
Expand All @@ -671,7 +671,7 @@ func TestPost(t *testing.T) {
{
Code: 104,
Header: http.Header{
"Upload-Draft-Interop-Version": []string{"3"},
"Upload-Draft-Interop-Version": []string{"4"},
"Location": []string{"http://tus.io/files/foo"},
"X-Content-Type-Options": []string{"nosniff"},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/handler/unrouted_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const UploadLengthDeferred = "1"
const currentUploadDraftInteropVersion = "3"
const currentUploadDraftInteropVersion = "4"

var (
reExtractFileID = regexp.MustCompile(`([^/]+)\/?$`)
Expand Down

0 comments on commit a2d0628

Please sign in to comment.