Skip to content

Commit

Permalink
fix: 🐛 use correct MIME type for mapbox vector tiles
Browse files Browse the repository at this point in the history
  • Loading branch information
DerZade committed Dec 4, 2023
1 parent 56de8a5 commit aefc7c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `from_bytes` associated function to `PMTiles`-, `Header`- and `Directory`-struct
- Add `from_bytes_partially` associated function to `PMTiles`-struct
- Add `find_entry_for_tile_id` method to `Directory`-struct
- Fix the MIME type for Mapbox Vector Tiles (previously `application/x-protobuf`, now `application/vnd.mapbox-vector-tile`)

## [0.2.2] - 2023-10-23
- Tweaks to documentation
Expand Down
4 changes: 2 additions & 2 deletions src/header/tile_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl TileType {
/// Returns [`None`] if a concrete `Content-Type` could not be determined.
pub const fn http_content_type(&self) -> Option<&'static str> {
match self {
Self::Mvt => Some("application/x-protobuf"),
Self::Mvt => Some("application/vnd.mapbox-vector-tile"),
Self::Png => Some("image/png"),
Self::Jpeg => Some("image/jpeg"),
Self::WebP => Some("image/webp"),
Expand All @@ -51,7 +51,7 @@ mod test {

assert_eq!(
TileType::Mvt.http_content_type(),
Some("application/x-protobuf")
Some("application/vnd.mapbox-vector-tile")
);

assert_eq!(TileType::Png.http_content_type(), Some("image/png"));
Expand Down

0 comments on commit aefc7c0

Please sign in to comment.