Skip to content

Commit

Permalink
fix: don't try to access contentType value which doesn't exist (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwkr committed May 22, 2024
1 parent cfba428 commit 1b66724
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ const mediaType = computed(() => {
const headers = normalizeHeaders(props.response?.headers)
// Get the content-type header
const contentTypeHeader = headers['content-type']
const contentTypeHeader = `${headers['content-type']}`
if (!contentTypeHeader) {
return null
}
// application/foobar+json; charset=utf-8 -> application/json
return normalizeMimeType(contentTypeHeader?.value)
return normalizeMimeType(contentTypeHeader)
})
// Determine the CodeMirror language based on the media type
Expand Down

0 comments on commit 1b66724

Please sign in to comment.