php - Response::json() returns text/html as content type -


I am currently experiencing a strange problem and I can not narrow this issue.

In my large application I am recovering the data via AJAX. Therefore, answer parts of the application with the application / JSON content-type.

  Return response: json (['message' = & gt; few messages']);   

Everything works fine on my local webserver. I get a content-type: application / jason as a response.

I deployed the application on the server ( also the epee ) and tested it. But here's the problem I'm not getting the proper content type anymore, instead I get the text / html .

So there is a bunch of potential problem sources and I am not very much in server configuration.

  • Why did the checker check the source for the indication that he will not return?
  • Feedback on local content and on server (this is not different)
  • I noticed that the set locally in the feedback header -cookie which includes the following: laravel_session = [...] while the server does not respond.

    Please refrain from posting answers that suggest content-type and parsing it on client side, if necessary, though it would be possible , The server should not behave like this and I'm trying to explain why

    itemprop = "text">

    Not on your production environment I know you have made sure that the server has Jason Extension and it is enabled, but you can double check on your production server You can:

    • Do you have AddType You have Apache configuration (on /etc/apache2/mods-available/mime.conf ) / json .json is the director?
    • Can you have mod mime enabled ( a2enmod mime ?)

  • Comments

    Popular posts from this blog

    ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

    Matlab transpose a table vector -

    c# - Textbox not clickable but editable -