Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 4, 2018. It is now read-only.
This repository was archived by the owner on Jul 4, 2018. It is now read-only.

HttpKernel BC break #438

@romainneutron

Description

@romainneutron

Commit symfony/http-kernel@538a38c introduced a BC break.

In a JSONP application context, we could want a 200 response, whatever happens (like in the foursquare API see https://developer.foursquare.com/overview/responses), let's assume we have a Silex error handler like this :

<?php
$app->error(function ($e, $code) use ($app) {
    if ($app['request']->getRequestFormat() == 'json') {
        $datas = array(
            'success' => false
            , 'message' => $e->getMessage()
        );

        return $app->json($datas);
    }
});

Before the mentionned commit, everything was OK ; right now it is impossible to customize the error handler as the returned response is tweaked in the HttpKernel before being sent.

I was questionning about posting this problem here or at symfony/symfony. Let me know if you want to move it there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions