Mime-type issue with some moodle modules

Mime-type issue with some moodle modules

by Kassim Machioudi -
Number of replies: 0

Hello,

Let me start by apologizing in case I am posting this question in the wrong section or in case this question has previously been discussed on this forum. I did an initial search on the forum and on Google and I was unable to find anything relevant. That being said here question.

Our school will soon be migrating from Moodle 1.9 to Moodle 2.1. To get ready for the big day, we have tried multiple test upgrades. We are running our Moodle test website behind a proxy in order to simulate our production URL (for internal reasons) and Apache mod_proxy is used to setup the proxy.

The situation we ran into is that our Moodle website is not working properly behind the proxy. The issue was tracked down to being related to Moodle sending incorrect myme-types under multiples circumstances including Ajax responses. Basically, some ajax services (not all services) responses are being sent using text/html instead of application/json, text/plain, etc.

The problem we are encountering is that Apache mod_proxy_html expects text/html content to be valid HTML. Therefore JSON responses sent with text/html myme-types are being wrapped with <html><body> tags (apparently it doesn’t seem to be possible to stop mod_proxy_html from doing so).

To make a long story short, our Moodle website doesn’t work properly behind Apache mod_proxy because of some Moodle modules returning Ajax responses with text/html mime-types or no myme-type at all.  Being a Moodle novice, I am trying to find out if there is a reason behind such behavior.

Any feedback will be greatly appreciated.

Thank you.

Average of ratings: -