2

I have a Python script which is executed for a specific URL and creates an iCal file that can be saved.

It all seems to be working fine except for the fact that, in the developer tools for Edge and Chrome, a warning is being given:

Edge: DOCTYPE expected. Consider adding a valid HTML5 doctype: “”. Chrome: Resource interpreted as Document but transferred with MIME type text/calendar

The script is setting the following headers:

Content-Type: text/calendar; charset=utf-8
Content-Disposition: attachment; filename="connect.ics"

It seems as if both browsers are expecting a HTML page to be returned rather than non-HTML content, despite the headers I've used.

Other SO questions on a similar topic (e.g. Chrome says: "Resource interpreted as Document but transferred with MIME type application/vnd.openxmlformats-officedocument.wordprocessingml.document") have suggested adding download to the A tag. This seems to be a HTML5 tag (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download). Adding that tag stops the message appearing in the developer tools but also stops the progress indicator from appearing!

So it seems I'm stuck between a rock and a hard place: have the progress indicator but get a warning in the developer tools, or fix the warning and have no progress indicator.

Not sure if the progress indicator thing is a bug but both Edge and Chrome behave the same way.

Is it possible to fix the warning and keep the progress indicator or should I just not worry about the warning?

Community
  • 1
  • 1
Philip Colmer
  • 1,426
  • 2
  • 17
  • 30

0 Answers0