Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Should not inject toolbar when response is expected to be application/json #44

Open
juslintek opened this issue Aug 25, 2020 · 2 comments

Comments

@juslintek
Copy link

Injects toolbar even if request has any of the headers:
Content-Type: application/json
Accept: application/json

Via postman you have to add this header:
X-Requested-With: XMLHttpRequest

But sometimes it doesn't exist even if request is async. :-)

@barryvdh
Copy link
Member

It should not add it with application/json content-type. Can you show your full response headers?

@github-grabaz
Copy link

I am seeing the same problem after installing.

Returning data from a route request using the following is injecting the toolbar:

// filename: web.php

    Route::get('/api/test', function () {
        $data = DB::connection('testdb')->table('testtable')->get();
        return $data->toJson();
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants