Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for NewRecorder (0.1 sec)

  1. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:50:49 UTC 2024
    - 39.8K bytes
    - Viewed (0)
  2. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:50:49 UTC 2024
    - 32.9K bytes
    - Viewed (0)
  3. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed May 22 23:07:14 UTC 2024
    - 30.2K bytes
    - Viewed (0)
  4. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Sep 03 06:33:53 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  5. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Sep 12 20:10:44 UTC 2024
    - 163.2K bytes
    - Viewed (0)
  6. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Aug 21 21:13:59 UTC 2024
    - 2.4K bytes
    - Viewed (0)
  7. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jul 24 10:24:01 UTC 2024
    - 13.9K bytes
    - Viewed (0)
  8. 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 Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Aug 18 06:43:03 UTC 2024
    - 22.3K bytes
    - Viewed (0)
  9. cmd/generic-handlers_test.go

    	var okHandler http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) {
    		w.WriteHeader(http.StatusOK)
    	}
    	for i, test := range sseTLSHandlerTests {
    		globalIsTLS = test.IsTLS
    
    		w := httptest.NewRecorder()
    		r := new(http.Request)
    		r.Header = test.Header
    		r.URL = test.URL
    
    		h := setRequestValidityMiddleware(okHandler)
    		h.ServeHTTP(w, r)
    
    		switch {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 29 18:10:04 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  10. cmd/bucket-lifecycle-handlers_test.go

    		shouldPass         bool
    	},
    ) {
    	for i, testCase := range testCases {
    		// initialize httptest Recorder, this records any mutations to response writer inside the handler.
    		rec := httptest.NewRecorder()
    		// construct HTTP request
    		req, err := newTestSignedRequestV4(testCase.method, getBucketLifecycleURL("", testCase.bucketName),
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:50:49 UTC 2024
    - 11.3K bytes
    - Viewed (0)
Back to top