We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
.includes(..)
.match(..)
1 parent 02de738 commit 9c01686Copy full SHA for 9c01686
include-fragment-element.js
@@ -123,7 +123,7 @@ export default class IncludeFragmentElement extends HTMLElement {
123
throw new Error(`Failed to load resource: the server responded with a status of ${response.status}`)
124
}
125
const ct = response.headers.get('Content-Type')
126
- if (!isWildcard(this.accept) && (!ct || !ct.match(this.accept ? this.accept : /^text\/html/))) {
+ if (!isWildcard(this.accept) && (!ct || !ct.includes(this.accept ? this.accept : 'text/html'))) {
127
throw new Error(`Failed to load resource: expected ${this.accept || 'text/html'} but was ${ct}`)
128
129
return response
0 commit comments