Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

preview_url on Matrix.org HS seems to return encoded blob instead of JSON #4921

Closed
jryans opened this issue Mar 22, 2019 · 5 comments
Closed
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)

Comments

@jryans
Copy link
Contributor

jryans commented Mar 22, 2019

The preview_url API seems to return an encoded response instead of JSON. For example, when trying: https://matrix.org/_matrix/media/r0/preview_url?url=https%3A%2F%2Fgit.luolix.top%2Fvector-im%2Friot-web%2Fissues%2F7153&ts=1553271576812:

$ curl 'https://matrix.org/_matrix/media/r0/preview_url?url=https%3A%2F%2Fgit.luolix.top%2Fvector-im%2Friot-web%2Fissues%2F7153&ts=1553271576812' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <access_token>'
\x7b226f673a696d61676...
@neilisfragile neilisfragile added z-bug (Deprecated Label) z-p2 (Deprecated Label) labels Mar 29, 2019
@hawkowl
Copy link
Contributor

hawkowl commented Apr 16, 2019

This looks awfully like that PostgreSQL encoding bug. @richvdh @erikjohnston do you know what the fix was? We might be inserting bytes into the table...

@richvdh
Copy link
Member

richvdh commented Apr 16, 2019

I'm not really sure it is fixed, cf #4475.

@ara4n
Copy link
Member

ara4n commented May 2, 2019

I'm getting bitten by this too:

$ curl 'https://matrix.org/_matrix/media/r0/preview_url?url=http%3A%2F%2Fgoogle.com' -H "Authorization: Bearer $token"
\x7b226f673a7469746c65223a2022476f6f676c65222c20226f673a696d616765223a20226d78633a2f2f6d61747269782e6f72672f323031392d30352d30325f417a567855424570634f724d63437152222c20226f673a6465736372697074696f6e223a202248616b755c6e5c6e4b75766168616b755c6e5c6e4d6170735c6e5c6e506c61795c6e5c6e596f75547562655c6e5c6e476d61696c5c6e5c6e44726976655c6e5c6e4b616c656e746572695c6e5c6e4c69735c6e5c6e5c75303062625c6e5c6e5665726b6b6f686973746f7269615c6e5c6e7c5c6e5c6e41736574756b7365745c6e5c6e7c5c6e5c6e4b69726a61756475207369736e5c6e5c6e5461726b656e6e657474752068616b755c6e5c6e4b69656c6974796b616c75745c6e5c6e476f6f676c656e2076657273696f743a5c6e5c6e7376656e736b61222c20226f673a696d6167653a7769647468223a203132382c20226f673a696d6167653a686569676874223a203132382c20226f673a696d6167653a74797065223a2022696d6167652f706e67222c20226d61747269783a696d6167653a73697a65223a20333432387d

@ara4n
Copy link
Member

ara4n commented May 2, 2019

it only seems to affect results which have been pulled out of the url preview cache.

@richvdh
Copy link
Member

richvdh commented Jan 14, 2021

this was another manifestation of #4475. In this case the problem was the og column in local_media_repository_url_cache.

It got fixed by #6186.

@richvdh richvdh closed this as completed Jan 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
z-bug (Deprecated Label) z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

5 participants