Opened 17 years ago

Closed 17 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: dev
Severity: Keywords: cache_page
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

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@… 17 years ago.
Proposed patch

Download all attachments as: .zip

Change History (5)

by eriks@…, 17 years ago

Attachment: django-utils-cache-py.patch added

Proposed patch

comment:1 by aaloy <aaloy@…>, 17 years ago

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 by James Bennett, 17 years ago

Triage Stage: UnreviewedAccepted

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 by Jacob, 17 years ago

Owner: changed from nobody to Jacob
Status: newassigned

comment:4 by Jacob, 17 years ago

Resolution: fixed
Status: assignedclosed

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

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