"Unauthenticated request, unsigned locator",
string(TEST_BLOCK),
response)
- received_xbs := response.Header().Get("X-Block-Size")
- expected_xbs := fmt.Sprintf("%d", len(TEST_BLOCK))
- if received_xbs != expected_xbs {
- t.Errorf("expected X-Block-Size %s, got %s", expected_xbs, received_xbs)
+
+ received_cl := response.Header().Get("Content-Length")
+ expected_cl := fmt.Sprintf("%d", len(TEST_BLOCK))
+ if received_cl != expected_cl {
+ t.Errorf("expected Content-Length %s, got %s", expected_cl, received_cl)
}
// ----------------
"Authenticated request, signed locator", http.StatusOK, response)
ExpectBody(t,
"Authenticated request, signed locator", string(TEST_BLOCK), response)
- received_xbs = response.Header().Get("X-Block-Size")
- expected_xbs = fmt.Sprintf("%d", len(TEST_BLOCK))
- if received_xbs != expected_xbs {
- t.Errorf("expected X-Block-Size %s, got %s", expected_xbs, received_xbs)
+
+ received_cl = response.Header().Get("Content-Length")
+ expected_cl = fmt.Sprintf("%d", len(TEST_BLOCK))
+ if received_cl != expected_cl {
+ t.Errorf("expected Content-Length %s, got %s", expected_cl, received_cl)
}
// Authenticated request, unsigned locator
// -------------------------------------------------------------
// Only the superuser should be allowed to issue /index requests.
- // ---------------------------
- // enforce_permissions enabled
+ // ---------------------------
+ // enforce_permissions enabled
// This setting should not affect tests passing.
- enforce_permissions = true
+ enforce_permissions = true
// unauthenticated /index request
// => UnauthorizedError
http.StatusOK,
response)
-
-
expected := `^` + TEST_HASH + `\+\d+ \d+\n` +
TEST_HASH_2 + `\+\d+ \d+\n$`
match, _ := regexp.MatchString(expected, response.Body.String())
var user_token = "USER TOKEN"
data_manager_token = "DATA MANAGER TOKEN"
+ pullq = NewWorkQueue()
+
good_json := []byte(`[
{
"locator":"locator_with_two_servers",
var user_token = "USER TOKEN"
data_manager_token = "DATA MANAGER TOKEN"
+ trashq = NewWorkQueue()
+
good_json := []byte(`[
{
"locator":"block1",
if rt.api_token != "" {
req.Header.Set("Authorization", "OAuth2 "+rt.api_token)
}
- routerWrapper := MakeRESTRouterWrapper()
- routerWrapper.ServeHTTP(response, req)
+ loggingRouter := MakeLoggingRESTRouter()
+ loggingRouter.ServeHTTP(response, req)
return response
}