Skip to content

Commit 13a44eb

Browse files
oliverkleeSam Tuke
authored and
Sam Tuke
committed
[BUGFIX] Keep text/html as content-type for non-REST routes (#58)
The application/json content type should only be used for routes that are part of our REST API.
1 parent 4ff25df commit 13a44eb

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

Tests/Integration/Controller/SessionControllerTest.php

+12
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ public function controllerIsAvailableViaContainer()
5151
self::assertInstanceOf(SessionController::class, $this->client->getContainer()->get(SessionController::class));
5252
}
5353

54+
/**
55+
* @test
56+
*/
57+
public function rootUrlHasHtmlContentType()
58+
{
59+
$this->client->request('get', '/');
60+
61+
$response = $this->client->getResponse();
62+
63+
self::assertContains('text/html', (string)$response->headers);
64+
}
65+
5466
/**
5567
* @test
5668
*/

composer.json

+5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@
103103
"enabled": true,
104104
"rules": [
105105
{
106+
"path": "^/api/v2/",
106107
"fallback_format": "json"
108+
},
109+
{
110+
"path": "^/",
111+
"fallback_format": "html"
107112
}
108113
]
109114
},

0 commit comments

Comments
 (0)