Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 48 for body (0.18 sec)

  1. cmd/server_test.go

    	c.Assert(err, nil)
    	// assert the http response status code.
    	c.Assert(response.StatusCode, http.StatusOK)
    
    	var buffer bytes.Buffer
    	// extract the body of the response.
    	responseBody, err := io.ReadAll(response.Body)
    	c.Assert(err, nil)
    	// assert the http response body content.
    	c.Assert(true, bytes.Equal(responseBody, buffer.Bytes()))
    }
    
    func (s *TestSuiteCommon) TestBucket(c *check) {
    	// generate a random bucket name.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 108K bytes
    - Viewed (0)
  2. cmd/auth-handler.go

    	if action == policy.CreateBucketAction {
    		// To extract region from XML in request body, get copy of request body.
    		payload, err := io.ReadAll(io.LimitReader(r.Body, maxLocationConstraintSize))
    		if err != nil {
    			authZLogIf(ctx, err, logger.ErrorKind)
    			return ErrMalformedXML
    		}
    
    		// Populate payload to extract location constraint.
    		r.Body = io.NopCloser(bytes.NewReader(payload))
    		region, s3Err = parseLocationConstraint(r)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26K bytes
    - Viewed (0)
  3. cmd/test-utils_test.go

    	// Seek back to beginning.
    	body.Seek(0, 0)
    
    	// Add body
    	req.Body = io.NopCloser(body)
    	req.ContentLength = contentLength
    
    	return req, nil
    }
    
    func assembleStreamingChunks(req *http.Request, body io.ReadSeeker, chunkSize int64,
    	secretKey, signature string, currTime time.Time) (*http.Request, error,
    ) {
    	regionStr := globalSite.Region
    	var stream []byte
    	var buffer []byte
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri May 03 17:26:51 GMT 2024
    - 76.2K bytes
    - Viewed (0)
  4. cmd/update.go

    		}
    	}
    	defer xhttp.DrainBody(resp.Body)
    
    	if resp.StatusCode != http.StatusOK {
    		return content, AdminError{
    			Code:       AdminUpdateUnexpectedFailure,
    			Message:    fmt.Sprintf("Error downloading URL %s. Response: %v", u, resp.Status),
    			StatusCode: resp.StatusCode,
    		}
    	}
    
    	contentBytes, err := io.ReadAll(resp.Body)
    	if err != nil {
    		return content, AdminError{
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 18.7K bytes
    - Viewed (0)
  5. cmd/handler-utils_test.go

    	// Corrupted XML
    	malformedReq := &http.Request{
    		Body:          io.NopCloser(bytes.NewReader([]byte("<>"))),
    		ContentLength: int64(len("<>")),
    	}
    
    	// Not an XML
    	badRequest := &http.Request{
    		Body:          io.NopCloser(bytes.NewReader([]byte("garbage"))),
    		ContentLength: int64(len("garbage")),
    	}
    
    	// generates the input request with XML bucket configuration set to the request body.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  6. cmd/bucket-policy-handlers.go

    	if r.ContentLength > maxBucketPolicySize {
    		writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrPolicyTooLarge), r.URL)
    		return
    	}
    
    	bucketPolicyBytes, err := io.ReadAll(io.LimitReader(r.Body, r.ContentLength))
    	if err != nil {
    		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    		return
    	}
    
    	bucketPolicy, err := policy.ParseBucketPolicyConfig(bytes.NewReader(bucketPolicyBytes), bucket)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  7. cmd/auth-handler_test.go

    		}
    	}
    }
    
    // Provides a fully populated http request instance, fails otherwise.
    func mustNewRequest(method string, urlStr string, contentLength int64, body io.ReadSeeker, t *testing.T) *http.Request {
    	req, err := newTestRequest(method, urlStr, contentLength, body)
    	if err != nil {
    		t.Fatalf("Unable to initialize new http request %s", err)
    	}
    	return req
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  8. internal/rest/client.go

    func (c *Client) newRequest(ctx context.Context, u url.URL, body io.Reader) (*http.Request, error) {
    	rc, ok := body.(io.ReadCloser)
    	if !ok && body != nil {
    		rc = io.NopCloser(body)
    	}
    	req := &http.Request{
    		Method:     http.MethodPost,
    		URL:        &u,
    		Proto:      "HTTP/1.1",
    		ProtoMajor: 1,
    		ProtoMinor: 1,
    		Header:     make(http.Header),
    		Body:       rc,
    		Host:       u.Host,
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  9. cmd/api-errors.go

    		Code:           "InvalidStorageClass",
    		Description:    "Invalid storage class.",
    		HTTPStatusCode: http.StatusBadRequest,
    	},
    	ErrInvalidRequestBody: {
    		Code:           "InvalidArgument",
    		Description:    "Body shouldn't be set for this request.",
    		HTTPStatusCode: http.StatusBadRequest,
    	},
    	ErrInvalidMaxUploads: {
    		Code:           "InvalidArgument",
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun May 05 16:56:21 GMT 2024
    - 91.4K bytes
    - Viewed (7)
  10. cmd/object-handlers.go

    				End:            -1,
    			}
    			opts.NoLock = true
    			return getObjectNInfo(ctx, bucket, object, rs, r.Header, opts)
    		},
    		actualSize,
    	)
    	defer objectRSC.Close()
    	s3Select, err := s3select.NewS3Select(r.Body)
    	if err != nil {
    		if serr, ok := err.(s3select.SelectError); ok {
    			encodedErrorResponse := encodeResponse(APIErrorResponse{
    				Code:       serr.ErrorCode(),
    				Message:    serr.ErrorMessage(),
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu May 02 20:15:54 GMT 2024
    - 125.2K bytes
    - Viewed (0)
Back to top