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

Validating the to-URL #2790

Closed
peterbe opened this issue Feb 3, 2021 · 7 comments
Closed

Validating the to-URL #2790

peterbe opened this issue Feb 3, 2021 · 7 comments
Assignees

Comments

@peterbe
Copy link
Contributor

peterbe commented Feb 3, 2021

In this PR a row was added to the _redirects.txt that looks like this:

/en-US/docs/Firefox     11

If you run the yarn tool validate-redirects it does not complain.

That to-URL doesn't look like a valid URL.

@peterbe
Copy link
Contributor Author

peterbe commented Feb 3, 2021

@fiji-flo Hi. Moved it to here instead.

@peterbe
Copy link
Contributor Author

peterbe commented Feb 3, 2021

Other examples that didn't get caught:

/en-US/docs/Mozilla_event_reference/DOMContentLoading	(event)

/en-US/docs/URI/www	and

/en-US/docs/Web/Reference/Functions_and	classes_available_to_workers

@fiji-flo
Copy link
Contributor

fiji-flo commented Feb 3, 2021

More work than expected. Lovely lower-case issues and stuff. Tomorrow :/

@peterbe
Copy link
Contributor Author

peterbe commented Feb 3, 2021

I noticed that Florian S used the move CLI command and that's what go these lines into the _redirects.txt in the first place. That's unrelated and related at the same time.

Either way, I could make a PR through the GitHub UI and manually type some junk into the _redirects.txt file with the textarea and I should get caught for doing it.

@ghost
Copy link

ghost commented Feb 3, 2021

I'm not sure but it occurred to me to search if you can lock files with Git or with GitHub.
The _ would be private right? As some do with variables in JavaScript
https://github.com/git-lfs/git-lfs/wiki/File-Locking (never used this CLI but talks about edit .gitattributes)


I have thought about it, apparently file permissions are a task in the hands of the filesystem, I am afraid that this triggers Linux / Windows issues easily and it is not the case to trigger them. I also thought that to save data in a structured way and have the user functionality there are databases. But they are deductions from a self-taught designer coder so feel free to contradict me.

@schalkneethling
Copy link
Contributor

@fiji-flo is this still an issue to address?

@fiji-flo
Copy link
Contributor

fiji-flo commented Nov 3, 2021

I think that's fixed:

yarn content validate-redirects

Checking /Users/fiji/github/content/files/en-us/_redirects.txt
info: Unable to load redirects: Error: To-URL has to be external or start with / (11)

error: 🔥 Errors loading redirects 🔥

@fiji-flo fiji-flo closed this as completed Nov 3, 2021
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

No branches or pull requests

3 participants