From c57cb629172fcefc473221ff0a2d9c4999e63cf7 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sat, 24 Feb 2024 08:54:44 +1100 Subject: [PATCH] Fix JSON responses from micropub endpoint --- config.ru | 2 +- slices/micropub/actions/site/config.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.ru b/config.ru index c7b64a3..872d471 100644 --- a/config.ru +++ b/config.ru @@ -25,7 +25,7 @@ end require "adamantium/middleware/header_fix" use Adamantium::Middleware::HeaderFix do |headers, env| - unless headers["Content-Type"]&.include? "xml" + unless headers["Content-Type"]&.downcase&.include?("xml") || headers["Content-Type"]&.downcase&.include?("json") headers["Content-Type"] = "text/html; charset=utf-8" end end diff --git a/slices/micropub/actions/site/config.rb b/slices/micropub/actions/site/config.rb index 4a1cd33..946ece0 100644 --- a/slices/micropub/actions/site/config.rb +++ b/slices/micropub/actions/site/config.rb @@ -8,7 +8,7 @@ module Micropub def handle(req, res) if req.params[:q] == "config" res.status = 200 - res.content_type = "application/json" + res.content_type = "Application/JSON" res.body = { "media-endpoint" => settings.micropub_media_endpoint, "destination" => [