- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 15 for NewRecorder (0.09 sec)
-
cmd/bucket-handlers_test.go
t.Fatalf("Test %v: expected failure, but succeeded with %v", instanceType, rec.Code) } // Verify response of the V2 signed HTTP request. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV2 := httptest.NewRecorder() // construct HTTP request for DELETE bucket.
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 39.8K bytes - Viewed (0) -
cmd/bucket-policy-handlers_test.go
for i, testCase := range testCases { // obtain the put bucket policy request body. // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV4 := httptest.NewRecorder() // construct HTTP request for PUT bucket policy endpoint. reqV4, err := newTestSignedRequestV4(http.MethodPut, getPutPolicyURL("", testCase.bucketName),
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 32.9K bytes - Viewed (0) -
cmd/post-policy_test.go
if !globalBrowserEnabled { globalBrowserEnabled = true defer func() { globalBrowserEnabled = false }() } // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. rec := httptest.NewRecorder() req, perr := newPostRequestV4("", bucketName, objectName, []byte("pwned"), credentials.AccessKey, credentials.SecretKey) if perr != nil {
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 30.6K bytes - Viewed (0) -
cmd/object-handlers_test.go
var reqV4, reqV2 *http.Request var recV4, recV2 *httptest.ResponseRecorder // initialize HTTP NewRecorder, this records any mutations to response writer inside the handler. recV4 = httptest.NewRecorder() recV2 = httptest.NewRecorder() // setting a non-existent uploadID. // deliberately introducing the invalid value to be able to assert the response with the expected error response.
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 163.1K bytes - Viewed (0) -
cmd/object-handlers-common_test.go
objInfo: objInfo, expectedFlag: true, expectedCode: 304, }, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { recorder := httptest.NewRecorder() request := httptest.NewRequest(http.MethodHead, "/bucket/a", bytes.NewReader([]byte{})) request.Header.Set(xhttp.IfNoneMatch, tc.ifNoneMatch) request.Header.Set(xhttp.IfModifiedSince, tc.ifModifiedSince)
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Wed Apr 09 14:28:39 UTC 2025 - 5.3K bytes - Viewed (0) -
cmd/object-api-options_test.go
"test1": {}, "test2": {}, "test3": {}, "test4": {}, }, }, } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { rec := httptest.NewRecorder() req := httptest.NewRequest("GET", "/test", nil) req.Header = testCase.headers opts, _ := getAndValidateAttributesOpts(ctx, rec, req, bucket, "testobject")
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Wed Apr 09 14:28:39 UTC 2025 - 2.4K bytes - Viewed (0) -
cmd/admin-handlers_test.go
}() } credentials := globalActiveCred req, err := getServiceCmdRequest(cmd, credentials) if err != nil { t.Fatalf("Failed to build service status request %v", err) } rec := httptest.NewRecorder() adminTestBed.router.ServeHTTP(rec, req) resp, _ := io.ReadAll(rec.Body) if rec.Code != http.StatusOK { t.Errorf("Expected to receive %d status code but received %d. Body (%s)",
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 13.9K bytes - Viewed (1) -
cmd/kms-handlers_test.go
accessKey = userAccessKey secretKey = userSecretKey } req := buildKMSRequest(t, test.method, test.path, accessKey, secretKey, test.query) rec := httptest.NewRecorder() adminTestBed.router.ServeHTTP(rec, req) t.Logf("HTTP req: %s, resp code: %d, resp body: %s", req.URL.String(), rec.Code, rec.Body.String()) // Check status code if rec.Code != test.wantStatusCode {
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Wed Apr 09 14:28:39 UTC 2025 - 22.3K bytes - Viewed (0) -
cmd/object-lambda-handlers_test.go
sum := sha256.Sum256(body) req.Header.Set("X-Amz-Content-Sha256", hex.EncodeToString(sum[:])) req = signer.SignV4(*req, credentials.AccessKey, credentials.SecretKey, "", "us-east-1") rec := httptest.NewRecorder() api := objectAPIHandlers{ ObjectAPI: func() ObjectLayer { return obj }, } api.GetObjectLambdaHandler(rec, req) res := rec.Result() defer res.Body.Close()
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Jul 18 21:56:31 UTC 2025 - 5.2K bytes - Viewed (0) -
cmd/test-utils_test.go
return fmt.Sprintf("MinIO %s: %s fail for \"%s\": \n<Error> %s", instanceType, testType, testName, failMsg) } // httptest Recorder to capture all the response by the http handler. rec := httptest.NewRecorder() // reading the body to preserve it so that it can be used again for second attempt of sending unsigned HTTP request. // If the body is read in the handler the same request cannot be made use of.
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Fri Aug 29 02:39:48 UTC 2025 - 77K bytes - Viewed (0)