Skip to content
This repository
Browse code

[fix] Resource: xhtml+xml mimetype only on xhtml1_1 doctype

  • Loading branch information...
commit 78eab7944e4852adb93d1869e7fac5d4db284008 1 parent d606df3
Cédric Soulas cedricss authored

Showing 1 changed file with 16 additions and 11 deletions. Show diff stats Hide diff stats

  1. +16 11 stdlib/core/web/resource/resource_private.opa
27 stdlib/core/web/resource/resource_private.opa
@@ -704,17 +704,22 @@ default_customizers = [customizer_for_google_frame,required_customizer_for_incom
704 704 {body = <body id="Body">{body_content}{body_custom}{js_links_custom}{js_inline}</body>
705 705 head = head_custom
706 706 //Additional IE-specific fix -- note that the mime type can be ignored if the resource uses [override_mime_type]
707   - mime_type = match user_compat.renderer with
708   - /* hack for IE (considers application/xhtml+xml as files to save) */
709   - // FIXME: do this? http://www.w3.org/MarkUp/2004/xhtml-faq#ie
710   - | { Trident=_ } -> "text/html"
711   - /* work-around for Chrome & Safari's bug http://code.google.com/p/chromium/issues/detail?id=45440
712   - if we serve application/xhtml+xml, we loose the password-saving mechanism for login forms
713   - but unfortunately, with text/html, we loose some features (e.g. ability to have SVG)
714   - TODO: remove next line when Chrome bug 45440 is fixed */
715   - | { Webkit=_; variant=_ } -> "text/html"
716   - /* application/xhtml+xml is the right content-type by default */
717   - | _ -> "application/xhtml+xml"
  707 + mime_type =
  708 + match default_doctype.get() with
  709 + | {xhtml1_1} -> (
  710 + match user_compat.renderer with
  711 + /* hack for IE (considers application/xhtml+xml as files to save) */
  712 + // FIXME: do this? http://www.w3.org/MarkUp/2004/xhtml-faq#ie
  713 + | { Trident=_ } -> "text/html"
  714 + /* work-around for Chrome & Safari's bug http://code.google.com/p/chromium/issues/detail?id=45440
  715 + if we serve application/xhtml+xml, we loose the password-saving mechanism for login forms
  716 + but unfortunately, with text/html, we loose some features (e.g. ability to have SVG)
  717 + TODO: remove next line when Chrome bug 45440 is fixed */
  718 + | { Webkit=_; variant=_ } -> "text/html"
  719 + /* application/xhtml+xml is the right content-type by default */
  720 + | _ -> "application/xhtml+xml"
  721 + )
  722 + | _ -> "text/html"
718 723 end }
719 724
720 725 compute_everything(customizers, body:xhtml, user_agent) =

0 comments on commit 78eab79

Please sign in to comment.
Something went wrong with that request. Please try again.