1 diff --git a/server_test.go b/server_test.go
2 index fc225ce..2df3608 100644
5 @@ -446,63 +446,6 @@ func TestPostJSONUpload(t *testing.T) {
9 -func TestPostJSONUploadMaxExpiry(t *testing.T) {
11 - Config.maxExpiry = 300
13 - // include 0 to test edge case
14 - // https://github.com/andreimarcu/linx-server/issues/111
15 - testExpiries := []string{"86400", "-150", "0"}
16 - for _, expiry := range testExpiries {
17 - w := httptest.NewRecorder()
19 - filename := generateBarename() + ".txt"
22 - mw := multipart.NewWriter(&b)
23 - fw, err := mw.CreateFormFile("file", filename)
28 - fw.Write([]byte("File content"))
31 - req, err := http.NewRequest("POST", "/upload/", &b)
32 - req.Header.Set("Content-Type", mw.FormDataContentType())
33 - req.Header.Set("Accept", "application/json")
34 - req.Header.Set("Linx-Expiry", expiry)
39 - mux.ServeHTTP(w, req)
42 - t.Log(w.Body.String())
43 - t.Fatalf("Status code is not 200, but %d", w.Code)
46 - var myjson RespOkJSON
47 - err = json.Unmarshal([]byte(w.Body.String()), &myjson)
52 - myExp, err := strconv.ParseInt(myjson.Expiry, 10, 64)
57 - expected := time.Now().Add(time.Duration(Config.maxExpiry) * time.Second).Unix()
58 - if myExp != expected {
59 - t.Fatalf("File expiry is not %d but %s", expected, myjson.Expiry)
63 - Config.maxExpiry = 0
66 func TestPostExpiresJSONUpload(t *testing.T) {
68 w := httptest.NewRecorder()
69 @@ -1301,5 +1244,4 @@ func TestPutAndGetCLI(t *testing.T) {
70 if !strings.HasPrefix(contentType, "text/plain") {
71 t.Fatalf("Didn't receive file directly but %s", contentType)