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

Commit

Permalink
add json mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Jun 14, 2017
1 parent 2a49e82 commit 1d5a6ad
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
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

0 comments on commit 1d5a6ad

Please sign in to comment.