Skip to content

Commit

Permalink
feat: add geojson MIME type support
Browse files Browse the repository at this point in the history
  • Loading branch information
43656D authored and 43656D committed Aug 31, 2023
1 parent 55310ec commit 92ea739
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl MediaType {
"text/jscript" => map_js_like_extension(specifier, Self::Jsx),
"text/jsx" => Self::Jsx,
"text/tsx" => Self::Tsx,
"application/json" | "text/json" => Self::Json,
"application/json" | "text/json" | "application/geo+json" => Self::Json,
"application/wasm" => Self::Wasm,
// Handle plain and possibly webassembly
"text/plain" | "application/octet-stream"
Expand Down Expand Up @@ -227,6 +227,7 @@ impl MediaType {
Some("mjs") => Self::Mjs,
Some("cjs") => Self::Cjs,
Some("json") => Self::Json,
Some("geojson") => Self::Json,
Some("wasm") => Self::Wasm,
Some("tsbuildinfo") => Self::TsBuildInfo,
Some("map") => Self::SourceMap,
Expand Down Expand Up @@ -482,6 +483,7 @@ mod tests {
("foo/bar.cjs", MediaType::Cjs),
("foo/bar.jsx", MediaType::Jsx),
("foo/bar.json", MediaType::Json),
("foo/bar.geojson", MediaType::Json),
("foo/bar.wasm", MediaType::Wasm),
("foo/.tsbuildinfo", MediaType::TsBuildInfo),
("foo/.TSBUILDINFO", MediaType::TsBuildInfo),
Expand Down

0 comments on commit 92ea739

Please sign in to comment.