Search code examples
htmlcssazureazure-storage-account

storage account static website gives other values in Firefox as in IE and chrome


I have created a simple index.html file.In my storage account I have enabled the function statistic websites.When I paste this index.html file inside the $web container I can navigate to the file by 1. using the endpoint URL with the name of the file as index. 2. or by using the endpoint URL by typing the name of the file after the /

  1. the URL of my static website : https://storaccount.z6.web.core.windows.net/
  2. The URL I use to access the file https://storaccount.z6.web.core.windows.net/index.html Now comes the strange part.In Firefox I have the tag only inplemented when I use the url with the filename specified (2). even if I specify in azure portal that index.html is the index page.In Chrome neither the url or the url + filename have the tag implementedIn IE they both work. The URL and the URL + filename To give a little context:

HTML  file:
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> TABLE {border-width: 1px; border-style: solid; border-color: black; border-collapse: collapse;} TH {border-width: 1px; padding: 3px; border-style: solid; border-color: black; background-color: #6495ED;} TD {border-width: 1px; padding: 3px; border-style: solid; border-color: black;} </style> </head><body> <table> <colgroup><col/><col/><col/><col/><col/></colgroup> <tr><th>Date</th><th>Vm</th><th>ResourceGroup</th><th>Event Initiated By</th><th>Subscription Name</th></tr> <tr><td>16/04/2019</td><td></td><td></td><td></td><td>-</td></tr> <tr><td>16/04/2019</td><td></td><td></td><td></td><td>-</td></tr> <tr><td>09/04/2019</td><td>--</td><td>-</td><td></td><td>-</td></tr> <tr><td>26/04/2019</td><td></td><td></td><td>.</td><td>-</td></tr> <tr><td>15/04/2019</td><td></td><td></td><td></td><td>-</td></tr> <tr><td>26/04/2019</td><td></td><td></td><td></td><td></td></tr> <tr><td>29/04/2019</td><td></td><td></td><td></td><td>-</td></tr> <tr><td>08/04/2019</td><td>-</td><td></td><td></td><td>-</td></tr> </table> </body></html> 

enter image description here

enter image description here enter image description here

Is this my fault. That I didn't mention the style tag in the html file properly ? Is this a bug (read feature) of Azure ?

This is firefox: because Chrome gives Picture 1 with both URLs and IE gives picture 2 with both URLs


Solution

  • As mentioned in the comments, please check the Content-Type property of Report.html blob. In my experience, IE is somewhat more smarter in rendering content when content-type property is not defined.

    To fix the problem, please change the Content-Type property of the blob to text/html and you should see it rendered properly in Chrome as well.