forked from cory/tildefriends
		
	+ webp magic bytes.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4093 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
		| @@ -532,6 +532,9 @@ function sendData(response, data, type, headers) { | |||||||
| 			startsWithBytes(data, [0x47, 0x49, 0x46, 0x38, 0x39, 0x61])) { | 			startsWithBytes(data, [0x47, 0x49, 0x46, 0x38, 0x39, 0x61])) { | ||||||
| 			response.writeHead(200, Object.assign({"Content-Type": "image/gif", "Content-Length": data.byteLength}, headers || {})); | 			response.writeHead(200, Object.assign({"Content-Type": "image/gif", "Content-Length": data.byteLength}, headers || {})); | ||||||
| 			response.end(data); | 			response.end(data); | ||||||
|  | 		} else if (startsWithBytes(data, [0x52, 0x49, 0x46, 0x46, null, null, null, null, 0x57, 0x45, 0x42, 0x50])) { | ||||||
|  | 			response.writeHead(200, Object.assign({"Content-Type": "image/webp", "Content-Length": data.byteLength}, headers || {})); | ||||||
|  | 			response.end(data); | ||||||
| 		} else if (startsWithBytes(data, [null, null, null, null, 0x66, 0x74, 0x79, 0x70, 0x6d, 0x70, 0x34, 0x32])) { | 		} else if (startsWithBytes(data, [null, null, null, null, 0x66, 0x74, 0x79, 0x70, 0x6d, 0x70, 0x34, 0x32])) { | ||||||
| 			response.writeHead(200, Object.assign({"Content-Type": "audio/mpeg", "Content-Length": data.byteLength}, headers || {})); | 			response.writeHead(200, Object.assign({"Content-Type": "audio/mpeg", "Content-Length": data.byteLength}, headers || {})); | ||||||
| 			response.end(data); | 			response.end(data); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user