Skip to content

Only add signed urls for secure.notion-static.com urls #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2022

Conversation

remorses
Copy link
Contributor

@vercel
Copy link

vercel bot commented Jul 25, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-notion-x ✅ Ready (Inspect) Visit Preview Jul 25, 2022 at 4:45PM (UTC)
react-notion-x-minimal-demo ✅ Ready (Inspect) Visit Preview Jul 25, 2022 at 4:45PM (UTC)

@@ -235,7 +235,7 @@ export class NotionAPI {
// console.log(block, source)

if (source) {
if (source.indexOf('youtube') >= 0 || source.indexOf('vimeo') >= 0) {
if (!source.includes('secure.notion-static.com')) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always only encountered urls with secure.notion-static.com that needed to be signed, there may be more endpoints than this one

@normdoow
Copy link
Collaborator

normdoow commented Aug 5, 2022

This fixed some issues for me as well where uploaded videos weren't showing up.

Like this page for example: 849918ea9a9144ba9b84d70d512274ab

Trying to understand the full scope of changes that this will have before merging in.

Thanks!

@normdoow normdoow marked this pull request as ready for review August 6, 2022 17:19
@normdoow
Copy link
Collaborator

normdoow commented Aug 6, 2022

I've done some more testing and this seems to work well and not break anything.
067dd719a912471ea9a3ac10710e7fdf

@transitive-bullshit transitive-bullshit merged commit 53ca9e3 into NotionX:master Aug 8, 2022
@transitive-bullshit
Copy link
Member

I think this is the best fix for the issue. Thanks @remorses 🙏

chuyun pushed a commit to chuyun/react-notion-x that referenced this pull request Jul 13, 2023
Only add signed urls for `secure.notion-static.com` urls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NotionAPI getSignedfileUrls error HTTPError: Response code 400 (Bad Request)
3 participants