- Vary header should be set every time we vary the display based on an HTTP header value
$module = $router->getModule();
}
+ // Display can change depending on the requested language, so it shouldn't be cached whole
+ header('Vary: Accept-Language', false);
+
// Processes data from GET requests
$httpinput = $httpInput->process();
$input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
throw new HTTPException\BadRequestException();
}
- header('Vary: Accept', false);
-
if (!ActivityPub::isRequest()) {
DI::baseUrl()->redirect(str_replace('objects/', 'display/', DI::args()->getQueryString()));
}
protected function rawContent(array $request = [])
{
- header('Vary: Accept', false);
-
// @TODO: Replace with parameter from router
if (DI::args()->getArgc() <= 1 || (DI::args()->getArgv()[1] !== 'json')) {
if (!ActivityPub::isRequest()) {
protected function content(array $request = []): string
{
- header('Vary: Accept', false);
-
if (ActivityPub::isRequest()) {
$this->baseUrl->redirect(str_replace('display/', 'objects/', $this->args->getQueryString()));
}
protected function rawContent(array $request = [])
{
- header('Vary: Accept', false);
-
if (ActivityPub::isRequest()) {
$user = $this->database->selectFirst('user', ['uid'], ['nickname' => $this->parameters['nickname'] ?? '', 'account_removed' => false]);
if ($user) {
{
protected function rawContent(array $request = [])
{
+ header('Vary: Accept', false);
+
// @TODO: Replace with parameter from router
if (DI::args()->getArgv()[0] == 'xrd') {
if (empty($_GET['uri'])) {
*/
public static function isRequest(): bool
{
+ header('Vary: Accept', false);
+
$isrequest = stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/activity+json') ||
stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/json') ||
stristr($_SERVER['HTTP_ACCEPT'] ?? '', 'application/ld+json');