jjdelc / grumble

Full client side Micropub client
MIT License
5 stars 2 forks source link

Not POSTing to Micropub endpoint #4

Open skpy opened 6 years ago

skpy commented 6 years ago

I have been able to authenticate to my Micropub endpoint, but all attempts to create posts or notes fail. As far as my server logs can tell, it appears that Grumble is POSTing to /index.php, rather than /micropub/index.php. I have no idea how to diagnose or troubleshoot this any further, but am happy to supply any information you request.

jjdelc commented 6 years ago

The discoverLink function will parse the HTML and look for a <link/> tag that has rel=micropub and return that URL https://github.com/jjdelc/grumble/blob/master/src/main.js#L1

It does it only one time and then it saves this config in the browser's localStorage. You could open the devtools panel and see the "Storages" pane and see what's under the urlDiscoveredLinks:... key.

skpy commented 5 years ago

The urlDiscoveredLinks storage does properly identify the Micropub endpoint that my site is returning. When I submit an item, Grumble appears to POST to an invalid URL:

1.2.3.4 - - [27/Jun/2019:09:56:24 -0400] "POST /grumble/src/null HTTP/2.0" 404 38

I have Grumble installed in /grumble. I can successfully Indieauth login. Why is it POSTing to null like that?

jjdelc commented 5 years ago

yes that null is definitely a problem parsing. Grumble will parse the html and extract the micropub endpoint from the <link rel="micropub"/> tag. It doesn't suppor HTTP headers.

jjdelc commented 5 years ago

@skpy did you check that you have CORS enabled on your domain?

skpy commented 5 years ago

I believe I set the headers correctly in my server, but that produced no change in behavior.