mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
f5338260bb
added json list in a similar fashion to json object renamed object_type to object updated readme, index.html, and json.md to include objects and lists updated examples to be slightly cleaner and include lists replaced instances of json object (std::map and such) with the short version (object) accurate floating point number dumping (`6.0` instead of `6`) while taking 1/30th of the time (29 microseconds saved) added json list testing snuck in utf-8 middleware warning fix snuck in twitter card style for crowcpp.org site (makes social media cards look way better with a large image)
28 lines
548 B
C++
28 lines
548 B
C++
#pragma once
|
|
#include "crow/http_request.h"
|
|
#include "crow/http_response.h"
|
|
|
|
namespace crow
|
|
{
|
|
|
|
struct UTF8
|
|
{
|
|
struct context
|
|
{
|
|
};
|
|
|
|
void before_handle(request& /*req*/, response& /*res*/, context& /*ctx*/)
|
|
{
|
|
}
|
|
|
|
void after_handle(request& /*req*/, response& res, context& /*ctx*/)
|
|
{
|
|
if (get_header_value(res.headers, "Content-Type").empty())
|
|
{
|
|
res.set_header("Content-Type", "text/plain; charset=utf-8");
|
|
}
|
|
}
|
|
};
|
|
|
|
}
|