Skip to content

Commit

Permalink
chore: mime -> mrmime
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Dec 1, 2021
1 parent 6008daf commit d93f33f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"bundt": "1.0.1",
"esm": "3.2.25",
"httpie": "2.0.0-next.7",
"mime": "2.4.6",
"mrmime": "1.0.0",
"selfsigned": "1.10.7",
"uvu": "0.5.2"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/sirv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from 'fs';
import { join, normalize, resolve } from 'path';
import { parse } from '@polka/url';
import list from 'totalist/sync';
import mime from 'mime/lite';
import { lookup } from 'mrmime';

const noop = () => {};

Expand Down Expand Up @@ -96,7 +96,7 @@ const ENCODING = {
function toHeaders(name, stats, isEtag) {
let enc = ENCODING[name.slice(-3)];

let ctype = mime.getType(name.slice(0, enc && -3)) || '';
let ctype = lookup(name.slice(0, enc && -3)) || '';
if (ctype === 'text/html') ctype += ';charset=utf-8';

let headers = {
Expand Down
4 changes: 2 additions & 2 deletions packages/sirv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@polka/url": "^1.0.0-next.20",
"mime": "^2.3.1",
"mrmime": "^1.0.0",
"totalist": "^1.0.0"
}
}
}
4 changes: 2 additions & 2 deletions tests/helpers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as fs from 'fs';
import { join } from 'path';
import mime from 'mime/lite';
import { send } from 'httpie';
import * as mime from 'mrmime';
import { promisify } from 'util';
import { createServer } from 'http';
import * as child from 'child_process';
Expand Down Expand Up @@ -77,7 +77,7 @@ export async function lookup(filepath, enc) {
let stats = await statfile(full);
filedata = await readfile(full, enc);

let ctype = mime.getType(full) || '';
let ctype = mime.lookup(full) || '';
if (ctype === 'text/html') ctype += ';charset=utf-8';

return CACHE[filepath] = {
Expand Down

0 comments on commit d93f33f

Please sign in to comment.