Code

Opened 7 years ago

Closed 7 years ago

#5557 closed (fixed)

The cache_page decorator fails on urls containing spaces

Reported by: eriks@… Owned by: jacob
Component: Core (Cache system) Version: master
Severity: Keywords: cache_page
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Memcache raises an exception when a key contains a space. The cache_page decorator does not escape the url of the page causing a server error.
The included patch wraps the use of request.path with a call to uri_to_iri()

Attachments (1)

django-utils-cache-py.patch (1.8 KB) - added by eriks@… 7 years ago.
Proposed patch

Download all attachments as: .zip

Change History (5)

Changed 7 years ago by eriks@…

Proposed patch

comment:1 Changed 7 years ago by aaloy <aaloy@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

This error also occurs when memcached tries to caché an url item that gives 404 error. Django tries to generate a key with the prefix, the url and the error message.

views.decoratore.cache_header.tc./trobacasa/promocion/1/Error obrint la imatge /home/aaloy/wor/apsl/media/promociones/2006/12/04/2-foto.jpg

comment:2 Changed 7 years ago by ubernostrum

  • Triage Stage changed from Unreviewed to Accepted

We've run into this a couple times at World Online, and used various workarounds. It'd be nice to solve it once and for all in Django's caching system.

comment:3 Changed 7 years ago by jacob

  • Owner changed from nobody to jacob
  • Status changed from new to assigned

comment:4 Changed 7 years ago by jacob

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

(In [6435]) Fixed #5557: URLs are now properly escaped in the cache_page decorator. Thanks, eriks.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.