NotionX / NotionX/react-notion-x

Image URL from file properties are forbidden to access

Open
#211 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Is this a known issue?

I'm not ready to publicly share the Notion page yet but the repro is simple:

  1. in a table, add a property of type file and upload an image.
  2. fetch that property and get the https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ url within it.
  3. open the url in browser (or in <img src>) and it will be 403 forbidden.

It seems like the official API is returning the same url except that the url is appended with a bunch of URL param e.g. X-Amz-Credential=... so it returns 200.

I also realized that in-page uploaded image works just fine but the URL encoding is a bit different, it started as https://www.notion.so/image/ and then the AWS url is appended as URL param encoded.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the table file-property case described in the issue and compare its returned URL with the in-page uploaded-image URL. Trace where the signed query parameters are lost; done means the resulting image URL loads successfully instead of returning 403.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.