]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Output proper HTML and XML headers for single Atom entry
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 6 May 2017 10:38:34 +0000 (12:38 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 6 May 2017 12:38:46 +0000 (14:38 +0200)
RFC5023 <https://tools.ietf.org/html/rfc5023> specifies that the
content type parameter 'type=entry' should be used to clarify data.

lib/apiaction.php

index 723e5894084c8573aaa89f766780a1325f5a11a5..18ec44bb2bcc7ec0560206d9428571e16f12d074 100644 (file)
@@ -790,7 +790,8 @@ class ApiAction extends Action
 
     function showSingleAtomStatus($notice)
     {
 
     function showSingleAtomStatus($notice)
     {
-        header('Content-Type: application/atom+xml; charset=utf-8');
+        header('Content-Type: application/atom+xml;type=entry;charset="utf-8"');
+        print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
         print $notice->asAtomEntry(true, true, true, $this->scoped);
     }
 
         print $notice->asAtomEntry(true, true, true, $this->scoped);
     }