Search Unity

WebGL issues on latest Chrome (Uncaught incorrect header check)

Discussion in 'Web' started by malu, Dec 12, 2015.

  1. malu

    malu

    Joined:
    Jun 26, 2013
    Posts:
    6
    Hi all,
    I have the error (Uncaught incorrect header check) on Chrome 47.0.2526.80. Firefox and Safari working fine. I am using OSX and Unity 5.3.0.f4

    Whats happening?
    The UnityLoader.js requesting the WebGL.data twice. The first request looks like the following:

    Request #1:
    1. Request URL:
      https://**.com/unity/Release/WebGL.data
    2. Request Method:
      GET
    3. Status Code:
      200 OK
    Response #1:

    HTTP/1.1 200 OK
    Server: nginx/1.4.6 (Ubuntu)
    Date: Sat, 12 Dec 2015 09:23:04 GMT
    Content-Type: application/octet-stream
    Content-Length: 114961309
    Last-Modified: Fri, 11 Dec 2015 08:39:27 GMT
    Connection: keep-alive
    Vary: Accept-Encoding
    ETag: "566a8bbf-6da2b9d"
    Content-Encoding: gzip​

    but the UnityLoader.js LoadCompressedFile.onProgress throws: net::ERR_CONNECTION_RESET so the file loading gets canceled after 11 megabytes loaded (out of 110MB).

    which seems to trigger the second request which looks like Request #1

    and the Response #2:

    HTTP/1.1 200 OK
    Server: nginx/1.4.6 (Ubuntu)
    Date: Sat, 12 Dec 2015 09:23:15 GMT
    Content-Type: application/octet-stream
    Content-Length: 114961309
    Last-Modified: Fri, 11 Dec 2015 08:39:27 GMT
    Connection: keep-alive
    Vary: Accept-Encoding
    ETag: "566a8bbf-6da2b9d"
    Content-Encoding: gzip​

    is loading the whole content of 110MB after the is complete the Error gets thrown:
    Error: Uncaught incorrect header check

    So any ideas? As said I working well with Firefox and Safari.

    PS: I am wondering why Unity(Loader.js) renames the requested files (+="gz") which I have defined before in the Module Object (dataUrl,memUrl...) gzip file selection by given request header information is the responsibility of the server and the loader shouldn't do that.
     
  2. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
  3. malu

    malu

    Joined:
    Jun 26, 2013
    Posts:
    6
    I am not using apache and as you can see in the posted Response Header the Content-Type is set. Thank you anyways. Since the problem occurs only at certain chrome versions and other browsers working I don't think the mime type settings lead to a fix.
     
  4. monark

    monark

    Joined:
    May 2, 2008
    Posts:
    1,598
    I'm using IIS and getting Uncaught incorrect header check errors too, very little clear information on any of this.
     
  5. nonlin

    nonlin

    Joined:
    Dec 12, 2013
    Posts:
    46
    Monark , my IIS local works using this web config.

    Code (CSharp):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <configuration>
    3.     <system.webServer>
    4.         <staticContent>
    5.           <mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
    6.           <mimeMap fileExtension=".data" mimeType="application/octet-stream" />
    7.           <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
    8.           <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
    9.           <mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
    10.           <mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />
    11.         </staticContent>
    12.     </system.webServer>
    13. </configuration>
    Sadly though I can't get webGL working on a server that uses htaccess. Maybe I need to convert this to htaccess some how? I keep getting the Incorrect Header on my web host, but again works great on my IIS.
     
    Meltdown likes this.
  6. BrienKing

    BrienKing

    Joined:
    Oct 11, 2015
    Posts:
    35
    I am also getting this error using IIS
     
  7. ScruffyFurn

    ScruffyFurn

    Joined:
    Mar 25, 2014
    Posts:
    1
    Had this issue too its due to the Web.config (tested on IIS on Azure). I created a short video that has the fix in it here ... http://blogs.msdn.com/b/cdndevs/archive/2016/01/05/hosting-unity-webgl-games-on-azure.aspx

    This is the web config I used

    <configuration>
    <system.webServer>
    <staticContent>
    <remove fileExtension=".mem" />
    <mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
    <remove fileExtension=".data" />
    <mimeMap fileExtension=".data" mimeType="application/octet-stream" />
    <remove fileExtension=".memgz" />
    <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
    <remove fileExtension=".datagz" />
    <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
    <remove fileExtension=".unity3dgz" />
    <mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
    <remove fileExtension=".jsgz" />
    <mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />
    </staticContent>
    </system.webServer>
    </configuration>
     
    Linix, 8Observer8 and CanisLupus like this.
  8. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Thank you! This works. :)
     
  9. 8Observer8

    8Observer8

    Joined:
    Apr 29, 2015
    Posts:
    99
    Thank you very much! It works!
     
    Last edited: May 25, 2016
  10. 8Observer8

    8Observer8

    Joined:
    Apr 29, 2015
    Posts:
    99
    Last edited: May 25, 2016
  11. Fly3rAtH0m3

    Fly3rAtH0m3

    Joined:
    Jun 3, 2015
    Posts:
    1
    At a minimum for WebGL games to work under IIS you need to have or add the mime type for application/octet-stream .datagz and application/octet-stream .memgz. This can be done by creating a new site and pointing the path to your WebGL build folder (the one with the index.html), then go to your site in IIS and select the MIME Types feature. The add these 2 types. Browsing to the site should then work. This will create the web.config file in the WebGL root folder as well
     
    8Observer8 likes this.
  12. 8Observer8

    8Observer8

    Joined:
    Apr 29, 2015
    Posts:
    99
    I use this Web.config in root of my website:


    Code (CSharp):
    1. <?xml version="1.0"?>
    2.  
    3. <configuration>
    4.  
    5.   <system.web>
    6.     <compilation debug="false" targetFramework="4.0" />
    7.   </system.web>
    8.  
    9.   <system.webServer>
    10.     <staticContent>
    11.       <mimeMap fileExtension=".obj" mimeType="application/obj" />
    12.       <mimeMap fileExtension=".mtl" mimeType="application/mtl" />
    13.       <mimeMap fileExtension=".dds" mimeType="application/dds" />
    14.       <mimeMap fileExtension=".fbx" mimeType="application/fbx" />
    15.  
    16.       <mimeMap fileExtension=".mem" mimeType="application/octet-stream" />
    17.       <mimeMap fileExtension=".data" mimeType="application/octet-stream" />
    18.       <mimeMap fileExtension=".memgz" mimeType="application/octet-stream" />
    19.       <mimeMap fileExtension=".datagz" mimeType="application/octet-stream" />
    20.       <mimeMap fileExtension=".unity3dgz" mimeType="application/octet-stream" />
    21.       <mimeMap fileExtension=".jsgz" mimeType="application/x-javascript; charset=UTF-8" />
    22.     </staticContent>
    23.   </system.webServer>
    24.  
    25. </configuration>
    26.  
     
    F-N likes this.
  13. ankitlinuxbean

    ankitlinuxbean

    Joined:
    Feb 21, 2017
    Posts:
    7
  14. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    Code (CSharp):
    1.   var Module = {
    2.     TOTAL_MEMORY: 268435456,
    3.     errorhandler: null,            // arguments: err, url, line. This function must return 'true' if the error is handled, otherwise 'false'
    4.     compatibilitycheck: null,
    5.     dataUrl: "Release/.data",
    6.     codeUrl: "Release/.js",
    7.     memUrl: "Release/.mem",
    8.    
    9.   };
    10.  
    The file name is not present .....
     
  15. ankitlinuxbean

    ankitlinuxbean

    Joined:
    Feb 21, 2017
    Posts:
    7
    Yes but when i use this on my local server all works fine.
     
  16. ankitlinuxbean

    ankitlinuxbean

    Joined:
    Feb 21, 2017
    Posts:
    7
    New issue : UnityLoader.js 404 not found. But i have that file.