Skip to content
Myr

handler.test.ts

This file

Path

src/adapter/aws-lambda/handler.test.ts

29 lines · 1.4 KiB · TypeScript

Last changed by

fix: add missing tail to svg regex (#1788)Elias Brangebefore adoption521db64

History of this file

Take it

The walk stopped after 200 commits: lines older than ba04dac point at it.

Merge pull request #1436 from honojs/nextYusuke Wadabefore adoptionba04dac

lines 1–6why, one step back
1import { isContentTypeBinary, isContentEncodingBinary } from './handler'
23describe('isContentTypeBinary', () => {4 it('Should determine whether it is binary', () => {5 expect(isContentTypeBinary('image/png')).toBe(true)6 expect(isContentTypeBinary('font/woff2')).toBe(true)

fix: add missing tail to svg regex (#1788)Elias Brangebefore adoption521db64

lines 7–8why, one step back
7 expect(isContentTypeBinary('image/svg+xml')).toBe(false)
8 expect(isContentTypeBinary('image/svg+xml; charset=UTF-8')).toBe(false)

Merge pull request #1436 from honojs/nextYusuke Wadabefore adoptionba04dac

lines 9–29why, one step back
9 expect(isContentTypeBinary('text/plain')).toBe(false)
10 expect(isContentTypeBinary('text/plain; charset=UTF-8')).toBe(false)11 expect(isContentTypeBinary('text/css')).toBe(false)12 expect(isContentTypeBinary('text/javascript')).toBe(false)13 expect(isContentTypeBinary('application/json')).toBe(false)14 expect(isContentTypeBinary('application/ld+json')).toBe(false)15 expect(isContentTypeBinary('application/json; charset=UTF-8')).toBe(false)16 })17})1819describe('isContentEncodingBinary', () => {20 it('Should determine whether it is compressed', () => {21 expect(isContentEncodingBinary('gzip')).toBe(true)22 expect(isContentEncodingBinary('compress')).toBe(true)23 expect(isContentEncodingBinary('deflate')).toBe(true)24 expect(isContentEncodingBinary('br')).toBe(true)25 expect(isContentEncodingBinary('deflate, gzip')).toBe(true)26 expect(isContentEncodingBinary('')).toBe(false)27 expect(isContentEncodingBinary('unknown')).toBe(false)28 })29})