-
Notifications
You must be signed in to change notification settings - Fork 248
Treat URLs ending with .html and slashes or starting with www. as indistiguishable. #154
base: master
Are you sure you want to change the base?
Conversation
I don't understand why these tests aren't passing. I can't debug |
I need help. Looked again at this and still can't understand the problem. If someone could run the tests locally for this branch and identify what is wrong in the tests that aren't passing I would be delighted. |
Can you rebase this off master, I'd like to take a look at the tests with the changes we made to the CI. |
I'm personally not a fan of removing the .html and .htm however, I think if people are having an issue with /contact and /contact.html they should just upgrade to Gold and get proper sitewide forms. I do like the www subdomain however. |
for all newly registered forms, remove starting 'www.', ending slashes and ending '.html' or '.htm'. then, for all forms, try to fetch not only the url that comes in the Referer (after referrer_to_path), but also its same version without 'www.', without '.html' or '.htm' and without the ending slash. all existing forms will match as always. all new forms will be cleaned up and match against their cleaned version, it doesn't matter if their url change to add or remove 'www.', '.html' or '/' later.
when searching the form against the hash, use just the raw host and the host_cleaup(host) versions, don't check for bizarre intermediate cases. when checking the form host for non-hash forms, use host_cleanup once instead of doing multiple checks with rstrip, remove_www etc.
this doesn't fix anything.
The mistery of failing tests. |
@fiatjaf Can you remove the .html stuff, and just go with the www fix? |
For all newly registered forms, remove starting 'www.', ending slashes and ending '.html' or '.htm'.
Then, for all forms, try to fetch not only the url that comes in the Referer (after referrer_to_path), but also its same version without 'www.', without '.html' or '.htm' and without the ending slash.
All existing forms will match as always. all new forms will be cleaned up and match against their cleaned version, it doesn't matter if their url change to add or remove 'www.', '.html' or '/' later.