Closed pstuifzand closed 6 years ago
Does the micropub helper always return an array? Or should we still typecheck that and store an empty array otherwise?
https://github.com/grantcodes/micropub/blob/master/src/main.js#L505
It returns the json object itself when it is ok. It will call reject on error.
It could be a problem when the config endpoint doesn't return the right thing, but I'm not sure if this should be checked.
The MP spec says:
If no endpoints are defined, the value of the syndicate-to object SHOULD be an empty JSON array [].
But doesn’t say it MUST, so we should probably coerce a non-array to []
That would mean that only the "response.ok" part should be removed from the if.
Yeah, looks like. If you want to do that, I'll merge in the change.
I tested it: Omnibear loads the syndication endpoints https://p83.nl/p/655
Thanks!
I put back the original fetchSyndicationTargets function. The response doesn't contain "ok", as the micropub helper returns the json object.