Skip to content

acceptance tests: the request log only records the last header of each request and response #4104

Description

@pbleser-oc

Describe the bug

The request log of the acceptance tests (tests/acceptance/logs/failed.log, printed by the CI's requests-log step) shows only one header per request and per response. HttpLogger::logRequest() and HttpLogger::logResponse() assign each header instead of appending it:

foreach ($response->getHeaders() as $key => $value) {
	$headers = $key . ": " . $value[0] . "\n";   // should be .=
}

(tests/acceptance/TestHelpers/HttpLogger.php, lines 76 and 105)

Expected behavior

All headers are logged, e.g. Content-Length, ETag, OC-FileId of a GET response.

Actual behavior

Only the last header is logged, usually Date. While looking into a failing test, this made a normal GET response look like a response without any headers, and it hides the file ID and ETag that would help to follow a file across requests.

Additional context

Each header line after the first would also need the \t\t indentation of the rest of the log, and only the first value of a header with several values is logged ($value[0]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions