Fix JSON responses from micropub endpoint
This commit is contained in:
@@ -25,7 +25,7 @@ end
|
|||||||
|
|
||||||
require "adamantium/middleware/header_fix"
|
require "adamantium/middleware/header_fix"
|
||||||
use Adamantium::Middleware::HeaderFix do |headers, env|
|
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"
|
headers["Content-Type"] = "text/html; charset=utf-8"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -8,7 +8,7 @@ module Micropub
|
|||||||
def handle(req, res)
|
def handle(req, res)
|
||||||
if req.params[:q] == "config"
|
if req.params[:q] == "config"
|
||||||
res.status = 200
|
res.status = 200
|
||||||
res.content_type = "application/json"
|
res.content_type = "Application/JSON"
|
||||||
res.body = {
|
res.body = {
|
||||||
"media-endpoint" => settings.micropub_media_endpoint,
|
"media-endpoint" => settings.micropub_media_endpoint,
|
||||||
"destination" => [
|
"destination" => [
|
||||||
|
Reference in New Issue
Block a user