Skip to content
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

feat(v2): prevent using remote image urls in showcase #3560

Merged
merged 5 commits into from
Oct 8, 2020

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Oct 8, 2020

Motivation

Ensure we never accept a remote url as showcase image on Docusaurus sites, as remote URLs are likely to break over time.

(example: #3556 (review))

@slorber slorber requested a review from lex111 as a code owner October 8, 2020 13:10
@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Oct 8, 2020
`User image should be self-hosted in /img/users folder. This was not the case for ${user.image}`,
);
}
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

seen this check just after, but does not. look like the appropriate place to do it.

@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 failed.

Built with commit d320339

https://app.netlify.com/sites/docusaurus-2/deploys/5f7f0fab98c3b3000967c3c2

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Oct 8, 2020

Deploy preview for docusaurus-2 ready!

Built with commit 4c5f220

https://deploy-preview-3560--docusaurus-2.netlify.app

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Oct 8, 2020
if (
!user.preview ||
user.preview.startsWith('http') ||
user.preview.startsWith('//')
Copy link
Contributor

Choose a reason for hiding this comment

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

CI fails because of this condition:

4:20:00 PM: TypeError: user.preview.startsWith is not a function
4:20:00 PM:     at Array.forEach (<anonymous>)
4:20:00 PM: (undefined) TypeError: user.preview.startsWith is not a function
4:20:00 PM:     at module.exports.users.forEach.user (main:35114:6781)
4:20:00 PM:     at Array.forEach (<anonymous>)
4:20:00 PM:     at Module.<anonymous> (main:35114:6735)
4:20:00 PM:     at __webpack_require__ (main:21:30)
4:20:00 PM:     at Promise.resolve.then (main:13011:7767)

@slorber slorber merged commit a3ab9c1 into master Oct 8, 2020
@slorber slorber added pr: maintenance This PR does not produce any behavior differences to end users when upgrading. and removed pr: new feature This PR adds a new API or behavior. labels Oct 8, 2020
@slorber slorber deleted the slorber/prevent-v1-showcase-external-links branch August 17, 2021 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants