legacy-knowledge-base
公開されました Jul. 2, 2025

Internet Explorer 11におけるPNGの互換性

投稿者

Brian Suh

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

この記事は、ドキュメントライブラリ にアップロードされた PNG ファイルが、 DOM7009 を持つ IE11 で 表示されないという既知の問題を説明しています:コンソールでURLの画像 をデコードできない。

セキュリティ対策として、またブラウザで悪意のあるスクリプトが実行されるのを防ぐために、LiferayはMIMEスニッフィングから保護するために X-Content-Type-Options: nosniff HTTPヘッダーを送ります。

system.propertiesのデフォルト値です:

# Set this to true for the portal to send the "X-Content-Type-Options:
# nosniff" HTTP header to protect against MIME sniffing. Custom URLs can
# specified in the property
# "http.header.secure.x.content.type.options.urls.excludes" that allow for
# unhindered MIME sniffing.
#
http.header.secure.x.content.type.options=true

この動作は、Internet Explorer 8(Microsoftのドキュメント)以来、知られており、意図されています。

要約すると、サーバーがレスポンスヘッダ X-Content-Type-Options: nosniffを送信すると、script と styleSheet 要素は不正な MIME タイプのレスポンスを拒否します。

解決策

この動作を解決するには、2つの選択肢があります。 この2つのオプションのいずれかを設定する場合は、潜在的なリスクを認識した上で、ご自身の判断で行ってください:

オプション1

Disable X-Content-Type-Options: nosniff Liferay から送信されています。

  1. system-ext.properties で http.header.secure.x.content.type.options=falseを設定します。
  2. ファイルを保存する
  3. サーバーを再起動する

オプション2

MIMEスニッフィングを許可する正確なURLを定義してください:

  1. system-ext.propertiesファイルに、system.propertiesのdefaultプロパティに見られるように、MIMEスニッフィングを妨げないようにするカンマ区切りのURLプレフィックスを設定します:
    # Set a list of comma delimited URL prefixes that allow for unhindered
    # MIME sniffing. This property is only used when the property
    # "http.header.secure.x.content.type.options" is set to true.
    # http.header.secure.x.content.type.options.urls.excludes=
  2. ファイルを保存する
  3. サーバーを再起動する
did-this-article-resolve-your-issue

legacy-knowledge-base