aaronpk / Aperture

Aperture is a Microsub server. Currently in beta.
https://aperture.p3k.io
Apache License 2.0
69 stars 5 forks source link

Timeline request returns `paging` as array #101

Closed njkleiner closed 3 years ago

njkleiner commented 3 years ago

When making a timeline request for an empty channel, the paging property returned is an empty array, rather than an empty object.

This makes it impossible to parse the response in some circumstances where the paging property is expected to always have the same type (i.e., JSON object).

$ curl -i -H "Authorization: Bearer <redacted>" "https://aperture.p3k.io/microsub/452?action=timeline&channel=2PkyeIadiaLZXnMVYdJVh7w7"

HTTP/2 200 
server: nginx/1.14.0
content-type: application/json
x-powered-by: PHP/7.2.7-1+ubuntu16.04.1+deb.sury.org+1
cache-control: no-cache, private
date: Sat, 30 Jan 2021 21:08:25 GMT

{"items":[],"paging":[]}
aaronpk commented 3 years ago

ah thanks, weird PHP thing! I will fix it.

njkleiner commented 3 years ago

ah thanks, weird PHP thing! I will fix it.

Thanks for the quick response!

I would've sent a PR, but I don't have PHP set up on my local machine.