Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#19532 closed Bug (invalid)

URL encoding error in set_script_prefix

Reported by: anonymous Owned by: nobody
Component: Core (URLs) Version: 1.5-beta-1
Severity: Release blocker Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by aaugustin)

We found this as a regression bug when we switched to using django 1.5.

We were generating a fully qualified url to be used as a link within an email, by doing

set_script_prefix('http://%s' % self.domain)

The url with this prefix was generated fine with django 1.4.3, but with 1.5, the url was turned into 'http%3A...'

Change History (4)

comment:1 Changed 3 years ago by aaugustin

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker
  • Type changed from Uncategorized to Bug

Clearly, this isn't the intended use of set_script_prefix.

However, we should find out which commit introduced this change and ensure that it was done for a good reason (rather than by accident).

Last edited 3 years ago by aaugustin (previous) (diff)

comment:2 Changed 3 years ago by claudep

I suppose that this behaviour was introduced in the commit [90e530978d590a5bd] that fixes #18210.

comment:3 Changed 3 years ago by apollo13

I can confirm that it was [90e530978d590a5bdcf75525aa03f844766018b8]. (Why do you have to be faster than me :/)

comment:4 Changed 3 years ago by aaugustin

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

set_script_prefix isn't documented; it's a private API, not subject to the backwards-compatibility policy.

Its behavior was changed on purpose, to fix a #18210. This isn't a regression.

The URL resolver doesn't deal with the domain part; you have to include it separately in the template.

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