Opened 10 years ago

Closed 8 years ago

#6129 closed (fixed)

"url" template-tag incorrectly encodes tilde (~) character in urls

Reported by: moe Owned by: Pete Crosier
Component: Template system Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The "url" template-tag encodes the tilde (~) character in urls
although it is a legal ("unreserved") URL character since
1995, cf. RFC2396.

RFC2396 (1995):
RFC3986 (2005):

This causes uglyness in the adressbar when a django app
wants to support the common http://server/~username/ URL-style.

Django should stick to the RFC and only encode characters
that must be encoded.

Attachments (1)

6129.django.utils.encoding.diff (415 bytes) - added by Pete Crosier 10 years ago.
Fix to leave tildes alone

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Pete Crosier

Fix to leave tildes alone

comment:1 Changed 10 years ago by Pete Crosier

Has patch: set
Owner: changed from nobody to Pete Crosier
Status: newassigned

I've attached a simple patch.. is it really this simple or am I missing something, would be good to get a professional opinion :D

comment:2 Changed 10 years ago by Pete Crosier

Status: assignednew

comment:3 Changed 10 years ago by Chris Beaven

Keywords: flapdoodle removed
Triage Stage: UnreviewedDesign decision needed

It does look that you're right.

comment:4 Changed 8 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

This is definitely a safe change to make and was already fixed in r12066 (along with a couple of other characters).

Note: See TracTickets for help on using tickets.
Back to Top