Skip to content

Telegraph should return the webmention server's Location header #31

@jamietanna

Description

@jamietanna

Some Webmention servers return a Location header that denotes the syndicated URL of the post. It would be good to have that returned, instead of needing to parse the http_body as JSON, if available:

% curl -i "https://telegraph.p3k.io/webmention/14SZAp2krq4B165GEQ"
HTTP/2 200
server: nginx/1.14.0
content-type: application/json
x-powered-by: PHP/5.6.40-13+ubuntu16.04.1+deb.sury.org+1
cache-control: no-cache
date: Sat, 18 Apr 2020 11:59:41 GMT

{
    "source": "https://www.jvt.me/mf2/2020/04/umb5a/",
    "target": "https://news.indieweb.org/en",
    "status": "accepted",
    "type": "webmention",
    "endpoint": "https://news.indieweb.org/en/webmention",
    "http_code": 201,
    "http_body": "{\n    \"result\": \"success\",\n    \"notices\": [\n        \"No \\\"name\\\" property found on the h-entry.\",\n        \"Already registered, updating properties of the post.\"\n    ],\n    \"data\": {\n        \"title\": false,\n        \"body\": false,\n        \"author\": \"https:\\/\\/desmondrivet.com\",\n        \"date\": \"2020-04-05T12:40:00+01:00\"\n    },\n    \"source\": \"https:\\/\\/www.jvt.me\\/mf2\\/2020\\/04\\/umb5a\\/\",\n    \"url\": \"https:\\/\\/news.indieweb.org\\/en\\/desmondrivet.com\\/2020\\/04\\/04\\/indieweb-conversation\"\n}",
    "summary": "The webmention request was accepted",
    "location": "https://telegraph.p3k.io/webmention/14SZAp2krq4B165GEQ"
}

Example of a Webmention server responding with a Location header:

% curl -i -d source=https://www.jvt.me/mf2/2020/04/umb5a/ -d target=https://news.indieweb.org/en https://news.indieweb.org/en/webmention
HTTP/2 201
server: nginx/1.14.2
date: Sat, 18 Apr 2020 12:05:29 GMT
content-type: application/json
location: https://news.indieweb.org/en/desmondrivet.com/2020/04/04/indieweb-conversation
set-cookie: PHPSESSID=ij198buf5527fsanfrubjbhgi0; path=/
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache

{
    "result": "success",
    "notices": [
        "No \"name\" property found on the h-entry.",
        "Already registered, updating properties of the post."
    ],
    "data": {
        "title": false,
        "body": false,
        "author": "https:\/\/desmondrivet.com",
        "date": "2020-04-05T12:40:00+01:00"
    },
    "source": "https:\/\/www.jvt.me\/mf2\/2020\/04\/umb5a\/",
    "url": "https:\/\/news.indieweb.org\/en\/desmondrivet.com\/2020\/04\/04\/indieweb-conversation"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions