Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jul 13, 2021
1 parent 0f9fd50 commit 8c66ec1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/kit/src/core/adapter-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
*
* This is intended to be used with both requests and responses, to have a consistent body parsing across adapters.
*
* @param {string} content_type The `content-type` header of a request/response.
* @param {string?} content_type The `content-type` header of a request/response.
* @returns {boolean}
*/
export function isContentTypeTextual(content_type) {
if (!content_type) return true; // defaults to json
const [type] = content_type.split(';'); // get the mime type
return (
!content_type || // defaults to json
content_type === 'text/plain' ||
content_type === 'application/json' ||
content_type === 'application/x-www-form-urlencoded' ||
Expand Down

0 comments on commit 8c66ec1

Please sign in to comment.