Skip to content

Commit

Permalink
Merge pull request #117 from pdsinterop/feature/multi-headers
Browse files Browse the repository at this point in the history
fix for sending multiple headers with the same value
  • Loading branch information
Potherca authored Feb 4, 2023
2 parents 063123d + b05fb0e commit a5736be
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
4 changes: 1 addition & 3 deletions solid/lib/Controller/CalendarController.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ private function respond($response) {
$result = new PlainResponse($body);

foreach ($headers as $header => $values) {
foreach ($values as $value) {
$result->addHeader($header, $value);
}
$result->addHeader($header, implode(", ", $values));
}

$result->setStatus($statusCode);
Expand Down
6 changes: 2 additions & 4 deletions solid/lib/Controller/ContactsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,9 @@ private function respond($response) {
$result = new PlainResponse($body);

foreach ($headers as $header => $values) {
foreach ($values as $value) {
$result->addHeader($header, $value);
}
$result->addHeader($header, implode(", ", $values));
}

$result->setStatus($statusCode);
return $result;
}
Expand Down
4 changes: 1 addition & 3 deletions solid/lib/Controller/ProfileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,7 @@ private function respond($response) {
$result = new PlainResponse($body);

foreach ($headers as $header => $values) {
foreach ($values as $value) {
$result->addHeader($header, $value);
}
$result->addHeader($header, implode(", ", $values));
}
// $origin = $_SERVER['HTTP_ORIGIN'] ?? "*";
// $result->addHeader('Access-Control-Allow-Credentials', 'true');
Expand Down
5 changes: 2 additions & 3 deletions solid/lib/Controller/StorageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,9 @@ private function respond($response) {
$result = new PlainResponse($body);

foreach ($headers as $header => $values) {
foreach ($values as $value) {
$result->addHeader($header, $value);
}
$result->addHeader($header, implode(", ", $values));
}

// $origin = $_SERVER['HTTP_ORIGIN'];
// $result->addHeader('Access-Control-Allow-Credentials', 'true');
// $result->addHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
Expand Down

0 comments on commit a5736be

Please sign in to comment.