Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
subrequests-3203617
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
subrequests-3203617
Commits
9d384907
Commit
9d384907
authored
3 years ago
by
paul121
Browse files
Options
Downloads
Patches
Plain Diff
Only use semi-colon separator in Content-Type header.
parent
18b0d853
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Normalizer/MultiresponseNormalizer.php
+1
-1
1 addition, 1 deletion
src/Normalizer/MultiresponseNormalizer.php
tests/src/Unit/Normalizer/MultiresponseNormalizerTest.php
+1
-2
1 addition, 2 deletions
tests/src/Unit/Normalizer/MultiresponseNormalizerTest.php
with
2 additions
and
3 deletions
src/Normalizer/MultiresponseNormalizer.php
+
1
−
1
View file @
9d384907
...
...
@@ -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'
]
);
...
...
This diff is collapsed.
Click to expand it.
tests/src/Unit/Normalizer/MultiresponseNormalizerTest.php
+
1
−
2
View file @
9d384907
...
...
@@ -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'
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment