Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jamietanna opened this issue Apr 18, 2020 · 2 comments
Open

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

jamietanna opened this issue Apr 18, 2020 · 2 comments

Comments

@jamietanna
Copy link

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"
}
@jamietanna
Copy link
Author

Per comment from http://vanderven.se/martijn/ on the IndieWeb chat notes that this looks like a bug with IndieNews' webmention server, as the Location must only be a status page, as per the spec

@Zegnat
Copy link

Zegnat commented Apr 18, 2020

Leaving aside the question of whether IndieNews is doing the right thing with that Location header…

If Telegraph were to pass on the webmention endpoint’s Location header I would expect for it to be some sort of “external status” property. Because that seems closest to what it means in this context.

When Telegraph has finished sending the webmention that is only half of the webmention’s life time. If the webmention endpoint answered Telegraph with a 201 Created response it means the webmention is still not completely handled by the receiver. In this case there may be a value to the original sender to be able to check on the status at the receiver’s end.

So maybe in this case Telegraph could provide an extra key in its JSON? Something like status_page to match the name given in the Webmention spec?

If the receiver creates a status page which the sender can use to check the status, the receiver MUST reply with an HTTP 201 Created response with a Location header pointing to the status URL. The response body MAY contain content.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants