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

Underscores should be omitted or mapped to hyphens in hostnames #148

Closed
ncoghlan opened this Issue Dec 11, 2011 · 10 comments

Comments

Projects
None yet
4 participants
@ncoghlan

ncoghlan commented Dec 11, 2011

This link confuses the Twitter URL shortener (i.e. it refuses to shorten it):
http://ncoghlan_devs-python-notes.readthedocs.org//en/latest/pep_ideas/index.html

This one works fine:
http://readthedocs.org/docs/ncoghlan_devs-python-notes/en/latest/pep_ideas/index.html

RFC 1123 restricts valid hostname characters to letters, numbers and the hyphen (i.e. no underscores allowed), so the Twitter shortener is actually doing the right thing in rejecting the first URL. It should really be:

http://ncoghlan-devs-python-notes.readthedocs.org//en/latest/pep_ideas/index.html

or

http://ncoghlandevs-python-notes.readthedocs.org//en/latest/pep_ideas/index.html

@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Feb 1, 2012

Member

This is going to be hard, since we already have projects that are using these. I can probably map it in nginx or something, but it's pretty low priority :/

Member

ericholscher commented Feb 1, 2012

This is going to be hard, since we already have projects that are using these. I can probably map it in nginx or something, but it's pretty low priority :/

@ncoghlan

This comment has been minimized.

Show comment
Hide comment
@ncoghlan

ncoghlan Jun 28, 2012

At the very least, could you not rewrite URLs that will create an illegal hostname? The PSF account tweeted a broken link to my Python Q & A because http://readthedocs.org/docs/ncoghlan_devs-python-notes/en/latest/python3/questions_and_answers.html gets immediately rewritten as an invalid URL.

ncoghlan commented Jun 28, 2012

At the very least, could you not rewrite URLs that will create an illegal hostname? The PSF account tweeted a broken link to my Python Q & A because http://readthedocs.org/docs/ncoghlan_devs-python-notes/en/latest/python3/questions_and_answers.html gets immediately rewritten as an invalid URL.

@samueljohn

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Jun 28, 2012

@ncoghlan is right. This sux a lot :-)

samueljohn commented Jun 28, 2012

@ncoghlan is right. This sux a lot :-)

@ncoghlan

This comment has been minimized.

Show comment
Hide comment
@ncoghlan

ncoghlan Jun 29, 2012

OK, I've now run out of options to workaround this:

  • I can't use a custom domain, because the subdomain is broken, thus I can't point a CNAME record at it
  • RTFD now automatically uses the subdomain, even when the hostname is invalid, so passing people the non-subdomain link is harder than it used to be, and may still not help if the redirect fails for them
  • I can't rename the project, because that would also break non-subdomain links that are valid

Ideally, what would happen is that projects with underscores in the name get two subdomains:

  • a legacy one with the underscore (for backwards compatibility of old links)
  • a new one with a hyphen (for RFC compliant hostnames)

Alternatively:

  • make underscores in project names illegal for all future projects
  • add an aliasing facility that lets us request a project name change with redirects set up from the old name to the new name

This is a real world problem - many URL shorteners fail to recognise links that use illegal hostnames, and Samuel's problems with getting to my article today make me believe that some validating browsers and/or proxies will also block HTTP requests to invalid hostnames. I could work around it previously (by never sharing the subdomain link), but that option has now been taken away from me by the automatic redirect.

ncoghlan commented Jun 29, 2012

OK, I've now run out of options to workaround this:

  • I can't use a custom domain, because the subdomain is broken, thus I can't point a CNAME record at it
  • RTFD now automatically uses the subdomain, even when the hostname is invalid, so passing people the non-subdomain link is harder than it used to be, and may still not help if the redirect fails for them
  • I can't rename the project, because that would also break non-subdomain links that are valid

Ideally, what would happen is that projects with underscores in the name get two subdomains:

  • a legacy one with the underscore (for backwards compatibility of old links)
  • a new one with a hyphen (for RFC compliant hostnames)

Alternatively:

  • make underscores in project names illegal for all future projects
  • add an aliasing facility that lets us request a project name change with redirects set up from the old name to the new name

This is a real world problem - many URL shorteners fail to recognise links that use illegal hostnames, and Samuel's problems with getting to my article today make me believe that some validating browsers and/or proxies will also block HTTP requests to invalid hostnames. I could work around it previously (by never sharing the subdomain link), but that option has now been taken away from me by the automatic redirect.

@samueljohn

This comment has been minimized.

Show comment
Hide comment
@samueljohn

samueljohn Jun 29, 2012

Not sure, what is the cause but I can now access http://ncoghlan_devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html in Safari. But still Twitter.app for Mac does not allow me to tweet the link.

samueljohn commented Jun 29, 2012

Not sure, what is the cause but I can now access http://ncoghlan_devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html in Safari. But still Twitter.app for Mac does not allow me to tweet the link.

@ncoghlan

This comment has been minimized.

Show comment
Hide comment
@ncoghlan

ncoghlan Jun 29, 2012

I at least just realised there is a simple solution to the renaming problem: create a new project and hook it up to the same backend source control repo.

So, let me change this request to: underscores should be made illegal in future project names (since they're not permitted by RFC 1123).

ncoghlan commented Jun 29, 2012

I at least just realised there is a simple solution to the renaming problem: create a new project and hook it up to the same backend source control repo.

So, let me change this request to: underscores should be made illegal in future project names (since they're not permitted by RFC 1123).

ericholscher added a commit that referenced this issue Jun 29, 2012

Sync non-underscored project names as well as underscored.
This addresses #148, and is the first step in migrating.
@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Jun 29, 2012

Member

http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/index.htmlshould
work and update from now on.

I'll let stuff soak for a couple of days to let projects get rebuilt with
_'s in them, and then switch over the links.

Cheers,
Eric

On Fri, Jun 29, 2012 at 8:06 AM, ncoghlan <
reply@reply.github.com

wrote:

I at least just realised there is a simple solution to the renaming
problem: create a new project and hook it up to the same backend source
control repo.

So, let me change this request to: underscores should be made illegal in
future project names (since they're not permitted by RFC 1123).


Reply to this email directly or view it on GitHub:
#148 (comment)

Eric Holscher
Engineer at Urban Airship in Portland, Or
http://ericholscher.com

Member

ericholscher commented Jun 29, 2012

http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/index.htmlshould
work and update from now on.

I'll let stuff soak for a couple of days to let projects get rebuilt with
_'s in them, and then switch over the links.

Cheers,
Eric

On Fri, Jun 29, 2012 at 8:06 AM, ncoghlan <
reply@reply.github.com

wrote:

I at least just realised there is a simple solution to the renaming
problem: create a new project and hook it up to the same backend source
control repo.

So, let me change this request to: underscores should be made illegal in
future project names (since they're not permitted by RFC 1123).


Reply to this email directly or view it on GitHub:
#148 (comment)

Eric Holscher
Engineer at Urban Airship in Portland, Or
http://ericholscher.com

@ncoghlan

This comment has been minimized.

Show comment
Hide comment
@ncoghlan

ncoghlan Jun 29, 2012

Thanks Eric, great to hear. For my specific case, I just finished creating a new "nick-coghlans-python-notes" project (hooked up from the python-notes.boredomandlaziness.org subdomain), but this change should ensure nobody else encounters the problem in the future.

As always, love the service :)

ncoghlan commented Jun 29, 2012

Thanks Eric, great to hear. For my specific case, I just finished creating a new "nick-coghlans-python-notes" project (hooked up from the python-notes.boredomandlaziness.org subdomain), but this change should ensure nobody else encounters the problem in the future.

As always, love the service :)

@xiongchiamiov

This comment has been minimized.

Show comment
Hide comment
@xiongchiamiov

xiongchiamiov Oct 30, 2013

Contributor

Is there additional work that needs to be done here, or should this be closed?

Contributor

xiongchiamiov commented Oct 30, 2013

Is there additional work that needs to be done here, or should this be closed?

@ericholscher

This comment has been minimized.

Show comment
Hide comment
@ericholscher

ericholscher Feb 14, 2014

Member

Closing this, as it's been mostly done. Now it's just dealing with the bug fallout like #666 -- Aptly numbered too :)

Member

ericholscher commented Feb 14, 2014

Closing this, as it's been mostly done. Now it's just dealing with the bug fallout like #666 -- Aptly numbered too :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment