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

Plone 5: sometimes response mime_type is text/plain #169

Open
keul opened this issue Jun 14, 2016 · 4 comments
Open

Plone 5: sometimes response mime_type is text/plain #169

keul opened this issue Jun 14, 2016 · 4 comments

Comments

@keul
Copy link
Contributor

keul commented Jun 14, 2016

How to reproduce:

  • create a new Plone site
  • install PFG
  • create a new form

On my environment the first attempt to create a PFG on a new site will show the HTML source (not interpreted) on the browser. By debugging the server response I see that the mime is text/plain.

schermata 2016-06-14 alle 16 40 01

I reproduced this issue on normal Plone usage but also on automated browser tests (see collective/uwosh.pfg.d2c#23)

No bloody idea of what cause this... maybe is only in development? Is Diazo?

@cdw9
Copy link

cdw9 commented Nov 14, 2017

We are also seeing this happen on a client instance, Plone 5.0.7. It's not only happening in development. It tends to only happen when you first visit the form, it goes back to normal after a refresh.

I've also seen the mime time set to "application/javascript" when the HTML displays.

I haven't tried fixing the edit form, but the view seems to be fixed by changing the default_view, immediate_view and view_methods to use fg_base_view_p3 instead of the view alias.

@mauritsvanrees
Copy link
Collaborator

Confirmed on Plone 5.0 for the first form that you try to create. No idea currently.

@cdw9
Copy link

cdw9 commented Jan 2, 2018

My fix above does not actually work, but I did find this:

I put a PDB into fgMaybeForceSSL. This function is hit twice. The first time, self.REQUEST.response.listHeaders() show the correct type. The second time, it is set to 'application/javascript'. I don't know what changes in the middle, but adding self.REQUEST.response.addHeader('Content-Type', 'text/html') here forces it to the correct type.

@cdw9
Copy link

cdw9 commented Jan 2, 2018

But even with the correct type, the page renders without the Diazo theme...

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