From b21f3600c08ecbb13057cb2a4abeb6feca0726de Mon Sep 17 00:00:00 2001 From: The-EDev Date: Sun, 15 Aug 2021 03:04:05 +0300 Subject: [PATCH 1/2] replaced outline with border because chrome doesn't round outline --- docs/overrides/home.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/overrides/home.html b/docs/overrides/home.html index e15ac171c..0fabf55f1 100644 --- a/docs/overrides/home.html +++ b/docs/overrides/home.html @@ -12,9 +12,9 @@ } .ccard{ - outline-style: solid; - outline-width: .1rem; - outline-color: #00000080; + border-style: solid; + border-width: .1rem; + border-color: #00000080; border-radius: 0.5rem; width: 10rem; height: 12rem; From 17819e65719b5df6c75021354f7640a62fa3d665 Mon Sep 17 00:00:00 2001 From: The-EDev Date: Sun, 15 Aug 2021 15:28:26 +0300 Subject: [PATCH 2/2] Added middleware to automatically use utf-8 if no content-type is in the response --- include/crow/middlewares/utf-8.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/crow/middlewares/utf-8.h diff --git a/include/crow/middlewares/utf-8.h b/include/crow/middlewares/utf-8.h new file mode 100644 index 000000000..909c9a2de --- /dev/null +++ b/include/crow/middlewares/utf-8.h @@ -0,0 +1,27 @@ +#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"); + } + } + }; + +}