Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

add json mime type #78

Merged
merged 1 commit into from
Jun 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/config/templates/mime.types
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ types {
image/svg+xml svg;

application/java-archive jar war ear;
application/json json;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
Expand Down
3 changes: 3 additions & 0 deletions spec/fixtures/mime_types_json/static.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"root": "www"
}
3 changes: 3 additions & 0 deletions spec/fixtures/mime_types_json/www/foo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"foo": "bar"
}
12 changes: 12 additions & 0 deletions spec/simple_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@
expect(response.body.chomp).to eq("Hello World")
end

describe "mime/types" do
let(:name) { "mime_types_json" }

context "json" do
it "should serve json as application/json content type" do
response = app.get("/foo.json")
expect(response.code).to eq("200")
expect(response["Content-Type"]).to eq("application/json")
end
end
end

describe "no config" do
let(:name) { "no_config" }

Expand Down