--- Global max ---
(t *testing.T)
| 118 | // --- Global max --- |
| 119 | |
| 120 | func TestUploadHandlerRejectsOversizedFile(t *testing.T) { |
| 121 | pngBytes := makePNGBytes(10, 10) |
| 122 | conf := &HttpServerConfigDef{ |
| 123 | AllowUpload: true, |
| 124 | ImageMaxUploadBytes: int64(len(pngBytes) - 1), |
| 125 | } |
| 126 | req := makeMultipartRequest(t, "image", "test.png", pngBytes) |
| 127 | res := httptest.NewRecorder() |
| 128 | makeUploadHandler(conf, guestIdentityManager(), nil, nil, nil).ServeHTTP(res, req) |
| 129 | assertFileTooLarge(t, res) |
| 130 | } |
| 131 | |
| 132 | func TestUploadHandlerAcceptsFileWithinGlobalLimit(t *testing.T) { |
| 133 | pngBytes := makePNGBytes(10, 10) |
nothing calls this directly
no test coverage detected