stephenou / fruitionsite

Build your website with Notion for free
https://fruitionsite.com
MIT License
1.59k stars 219 forks source link

Custom uploaded header images fail #43

Open alicam opened 4 years ago

alicam commented 4 years ago

Hi team.

I get this error message on screen when I try and go to the url of a custom uploaded header image:

{"errorId":"ebe6ebcb-ab44-4ac1-96b9-a6d45d472556","name":"ValidationError","message":"For secure file URLs, must specify table and id."}

Note that Unsplash images (with their own URLs) work find, as to "in-built" Notion header images. It's just your own images which you upload, and get saved top AWS S3, that fail with this error.

They're not recognised as "public".

Is there any way around this?

An example custom header image URL is https://www.qldvotes.org.au/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F20a0e53e-dbd3-41d0-ae41-d0b56124b9a4%2Fact-view-social.jpg?table=block&id=790e17ae-8450-47c8-920b-a6320b7bae7f&width=800&userId=&cache=v2

Thanks.

A

berniedurfee commented 4 years ago

I'm seeing the same thing. Looks like maybe a change with Notion? Maybe a cookie required to hit the URL?

sahildave commented 4 years ago

Hey, I am not big on coding but tinkered some stuff in here and it fixed it temporarily.

https://github.com/sahildave/fruitionsite/commit/36ebe8267b145c3f049cd81d0ceaf82907d043fc

szechy commented 4 years ago

Just confirming that @sahildave's code fix, fixes my site - both header images and embedded images in the main body. Thank you Sahil!

sahildave commented 4 years ago

Just dropping a warning. Although this works but like I said, I am not an expert, I can to this solution by a lot of trial & error. 😛 We should look for a proper solution.

alicam commented 4 years ago

Thanks Sahil. Your fix is what I also had in mind - passing the image straight thru without modding the URL.

I think it's as solid a fix as anyone else is going to come up with, to be honest.