Opened 7 years ago

Closed 7 years ago

Last modified 3 years ago

#7345 closed (fixed)

URLField should append / if no path is specified.

Reported by: jpwatts Owned by: mtredinnick
Component: Forms Version: master
Severity: Keywords: newforms urlfield
Cc: joel@…, apollo13 Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The equivalent URLs http://example.com and http://example.com/ are not being normalized to the same value by URLField.

Attachments (1)

urlfield.diff (3.8 KB) - added by jpwatts 7 years ago.
Patch to normalize path to / if none is specified (includes tests).

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by jpwatts

Patch to normalize path to / if none is specified (includes tests).

comment:1 Changed 7 years ago by Simon Greenhill

  • milestone set to 1.0 beta
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [8089]) Fixed #7345 -- When normalising the URLField form field, attach a trailing
slash when only a host (no path) is given. Thanks, jpwatts.

comment:3 Changed 7 years ago by Honza_Kral

  • Resolution fixed deleted
  • Status changed from closed to reopened

urlparse.urlsplit(value) returns a tuple in python 2.4 urlparse.urlsplit(value)[2] works as supposed to.

I have no access to test on other versions.

comment:4 Changed 7 years ago by mtredinnick

  • Owner changed from nobody to mtredinnick
  • Status changed from reopened to new
  • Triage Stage changed from Ready for checkin to Accepted

comment:5 Changed 7 years ago by anonymous

  • Cc apollo13 added

comment:6 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [8093]) Fixed #7345 -- In [8089], I'd forgotten that urlparse.urlsplit() didn't return
something with attributes until Python 2.5. Thanks, Honza Kral and apollo13.

comment:7 Changed 3 years ago by jacob

  • milestone 1.0 beta deleted

Milestone 1.0 beta deleted

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