-
Notifications
You must be signed in to change notification settings - Fork 193
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
when http URL is missing a slash in the report #767
Comments
I suggest a simple JS replace in the client-side form validation code - in the URL field change handler. |
i'll try working on this patch... |
The code that parses a URL into a domain lives here: https://github.com/webcompat/webcompat.com/blob/master/webcompat/form.py#L127 |
(I would start with that, I think that's the right place -- @karlcow can confirm ^_^) |
And this one will fail too. I suggest to create tests first for these, then patch. :) |
|
two questions:
edit: also, why should "https:example.com" become "http://example.com/" but "https:/example.com" become "https://example.com/"? |
(I'll let @karlcow answer these questions -- he's more knowledgeable about representing URIs and URLs and HTTP, etc. Just be a little patient @deckycoss, Karl is based in Tokyo so it's his weekend right now). |
>>> url = '//example.com/foo/bar'
>>> import urlparse
>>> urlparse.urlparse(url).netloc
'example.com' |
thanks @karlcow; this is quite helpful. |
This is minor. It happened once in
webcompat/web-bugs#1807
Or logic for parsing the URL and displaying the domain in the title of an issue fails when the URL is having an incorrect http. I'm merely filling the issue to have a record of the problem. It good be a good first patch.
To make it clearer.
The person typed/reported:
And then our code parsed it as
creating a title which is
https: - layout is messed up
instead ofamazon.com - layout is messed up
The text was updated successfully, but these errors were encountered: