aaronpk / micropub.rocks

Micropub test suite and debugging utility
https://micropub.rocks
Apache License 2.0
30 stars 10 forks source link

[Bug] Test Suite does not register successful responses from www-api.staging.jvt.me #86

Open jamietanna opened 4 years ago

jamietanna commented 4 years ago

Micropub.rocks seems to not register a response when using my staging Micropub endpoint:

curl -i https://www-api.staging.jvt.me/micropub -d 'h=entry&content=Micropub+test+of+creating+an+h-entry+with+categories.+This+post+should+have+two+categories,+test1+and+test2&category[]=test1&category[]=test2' -H 'Authorization: Bearer ...'

HTTP/2 202
cache-control: no-cache, no-store, max-age=0, must-revalidate
date: Thu, 26 Dec 2019 15:53:51 GMT
expires: 0
location: https://www.staging.jvt.me/post#eyJraW5kIjoibm90ZXMiLCJzbHVnIjpudWxsLCJjbGllbnRfaWQiOiJodHRwczovL21pY3JvcHViLnJvY2tzLyIsImRhdGUiOiIyMDE5LTEyLTI2VDE2OjUzOjUxLjE0NiswMTowMCIsImgiOiJoLWVudHJ5IiwicHJvcGVydGllcyI6eyJwdWJsaXNoZWQiOlsiMjAxOS0xMi0yNlQxNjo1Mzo1MS4xNDYrMDE6MDAiXSwiY2F0ZWdvcnkiOlsidGVzdDIiLCJ0ZXN0MSJdLCJjb250ZW50IjpbeyJodG1sIjoiIiwidmFsdWUiOiJNaWNyb3B1YiB0ZXN0IG9mIGNyZWF0aW5nIGFuIGgtZW50cnkgd2l0aCBjYXRlZ29yaWVzLiBUaGlzIHBvc3Qgc2hvdWxkIGhhdmUgdHdvIGNhdGVnb3JpZXMsIHRlc3QxIGFuZCB0ZXN0MiJ9XSwic3luZGljYXRpb24iOlsiaHR0cHM6Ly9icmlkLmd5L3B1Ymxpc2gvdHdpdHRlciJdfSwidGFncyI6WyJ0ZXN0MiIsInRlc3QxIl19
pragma: no-cache
server: Caddy
x-content-type-options: nosniff
x-frame-options: DENY
x-xss-protection: 1; mode=block
content-length: 0

Could this be related to the Location header returning a URL fragment not a querystring?

jamietanna commented 4 years ago

Looking in the Network tab of the browser, I see a 500 response from https://micropub.rocks/server-tests/micropub when hitting Run, which sends POST body:

test=34&endpoint=430&skipauth=0&method=post&body=h%3Dentry%26content%3DMicropub%2Btest%2Bof%2Bcreating%2Ban%2Bh-entry%2Bwith%2Bone%2Bcategory.%2BThis%2Bpost%2Bshould%2Bhave%2Bone%2Bcategory%2C%2Btest1%26category%3Dtest1
jamietanna commented 4 years ago

it's possible it's due to Caddy returning as HTTP/2 which returns the Location header as lowercase (because it's case-insensitive in HTTP/2)

jamietanna commented 4 years ago

Correction: it's valid to be case insensitive as per HTTP/1.1, but in HTTP/2 it always sends as lowercase https://superuser.com/a/1467474

jamietanna commented 4 years ago

Not 100% sure if it's related to the GuzzleHTTP client as I've run it locally against an HTTP/2 endpoint and case-sensitivity doesn't seem to be an issue.

@aaronpk is it possible to see if there's anything in the logs?

jamietanna commented 4 years ago

Disabling HTTP/2 on Caddy still results in a 500 from Micropub.rocks, so I believe it's an issue unrelated to HTTP version / header case sensitivity.