Commit 9d384907 authored by paul121's avatar paul121
Browse files

Only use semi-colon separator in Content-Type header.

parent 18b0d853
......@@ -18,7 +18,7 @@ class MultiresponseNormalizer implements NormalizerInterface {
// Prepare the root content type header.
$content_type = sprintf(
'multipart/related; boundary="%s", type=%s',
'multipart/related; boundary="%s"; type=%s',
$delimiter,
$context['sub-content-type']
);
......
......@@ -48,8 +48,7 @@ class MultiresponseNormalizerTest extends UnitTestCase {
$sub_content_type = $this->getRandomGenerator()->string();
$data = [Response::create('Foo!'), Response::create('Bar')];
$actual = $this->sut->normalize($data, NULL, ['sub-content-type' => $sub_content_type]);
$parts = explode(', ', $actual['headers']['Content-Type']);
$parts = explode('; ', $parts[0]);
$parts = explode('; ', $actual['headers']['Content-Type']);
parse_str($parts[1], $parts);
$delimiter = substr($parts['boundary'], 1, strlen($parts['boundary']) - 2);
$this->assertStringStartsWith('--' . $delimiter, $actual['content']);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment