Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting header "strict mime type"

i noticed, mybb doenst work when i set strict mime types in the header in my apache config

Header set X-Content-Type-Options "nosniff"

My development tools from my browser (opera - 58.0.3135.127) are saying:
[Image: 6LC023HGTmSqI8zy20tx7A.png]

In my apache config the file "/etc/mime.types" with most mime types is enabled.
It includes .css .js .json -- so everything should work...

Anyone knows how i can get rid of the problem and activate "strict mime types" again?

This is new installation. Only the installer was run.


btw... anyone knows what's up with the "lang is not defined" error?
I have never faced this issue even with strict mime type. A few questions :-
1. What are the changes you have in your version of MyBB and default ?
2. Are you using default MyBB theme or customized ?

Regarding the lang is not defined, can you check the headerinclude file if it has following variables defined ?
<script type="text/javascript">
	lang.unknown_error = "{$lang->unknown_error}";

	lang.select2_match = "{$lang->select2_match}";
	lang.select2_matches = "{$lang->select2_matches}";
	lang.select2_nomatches = "{$lang->select2_nomatches}";
	lang.select2_inputtooshort_single = "{$lang->select2_inputtooshort_single}";
	lang.select2_inputtooshort_plural = "{$lang->select2_inputtooshort_plural}";
	lang.select2_inputtoolong_single = "{$lang->select2_inputtoolong_single}";
	lang.select2_inputtoolong_plural = "{$lang->select2_inputtoolong_plural}";
	lang.select2_selectiontoobig_single = "{$lang->select2_selectiontoobig_single}";
	lang.select2_selectiontoobig_plural = "{$lang->select2_selectiontoobig_plural}";
	lang.select2_loadmore = "{$lang->select2_loadmore}";
	lang.select2_searching = "{$lang->select2_searching}";

	var templates = {
		modal: '{$jsTemplates['modal']}',
		modal_button: '{$jsTemplates['modal_button']}'

	var cookieDomain = "{$mybb->settings['cookiedomain']}";
	var cookiePath = "{$mybb->settings['cookiepath']}";
	var cookiePrefix = "{$mybb->settings['cookieprefix']}";
	var cookieSecureFlag = "{$mybb->settings['cookiesecureflag']}";
	var deleteevent_confirm = "{$lang->deleteevent_confirm}";
	var removeattach_confirm = "{$lang->removeattach_confirm}";
	var loading_text = '{$lang->ajax_loading}';
	var saving_changes = '{$lang->saving_changes}';
	var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
	var my_post_key = "{$mybb->post_code}";
	var rootpath = "{$mybb->settings['bburl']}";
	var imagepath = "{$theme['imgdir']}";
  	var yes_confirm = "{$lang->yes}";
	var no_confirm = "{$lang->no}";
	var MyBBEditor = null;
	var spinner_image = "{$theme['imgdir']}/spinner.gif";
	var spinner = "<img src='" + spinner_image +"' alt='' />";
	var modal_zindex = 9999;
// -->
If it is not present, keep a backup of your headerinclude and add the variables present inside the template.
Check it if it solves the issue.

Forum Jump:

Users browsing this thread: 1 Guest(s)