Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 678795 Details for
Bug 895562
[patch] Backport support to disable mimetype extension stripping
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Backport of disabling extension stripping from TG2-2.1
0001-Allow-disabling-mimetype-ext-Backport-patch-from-TG.patch (text/plain), 2.10 KB, created by
Ralph Bean
on 2013-01-15 14:33:51 UTC
(
hide
)
Description:
Backport of disabling extension stripping from TG2-2.1
Filename:
MIME Type:
Creator:
Ralph Bean
Created:
2013-01-15 14:33:51 UTC
Size:
2.10 KB
patch
obsolete
>From 34ff598fb1bbd54426e5b58ea84984215fdcd256 Mon Sep 17 00:00:00 2001 >From: Ralph Bean <rbean@redhat.com> >Date: Tue, 15 Jan 2013 14:25:34 +0000 >Subject: [PATCH] Allow disabling mimetype ext. Backport patch from TG2-2.1. > >Taken from commit 098040072f75b9b271f1739444bd9d3264df0431 >--- > tg/controllers.py | 29 +++++++++++++++-------------- > 1 files changed, 15 insertions(+), 14 deletions(-) > >diff --git a/tg/controllers.py b/tg/controllers.py >index e75daf0..3d9d7f8 100644 >--- a/tg/controllers.py >+++ b/tg/controllers.py >@@ -505,20 +505,21 @@ def _check_controller_auth(obj): > def _object_dispatch(obj, url_path): > remainder = url_path > >- request.response_type = None >- request.response_ext = None >- # if the last item in the remainder has an extention >- # remove the extension, and add a response content type to the >- # request parameters >- if remainder and '.' in remainder[-1]: >- last_remainder = remainder[-1] >- mime_type, encoding = mimetypes.guess_type(last_remainder) >- if mime_type: >- extension_spot = last_remainder.rfind('.') >- extension = last_remainder[extension_spot:] >- remainder[-1] = last_remainder[:extension_spot] >- request.response_type = mime_type >- request.response_ext = extension >+ if not pylons.config.get('disable_request_extensions', False): >+ request.response_type = None >+ request.response_ext = None >+ # if the last item in the remainder has an extention >+ # remove the extension, and add a response content type to the >+ # request parameters >+ if remainder and '.' in remainder[-1]: >+ last_remainder = remainder[-1] >+ mime_type, encoding = mimetypes.guess_type(last_remainder) >+ if mime_type: >+ extension_spot = last_remainder.rfind('.') >+ extension = last_remainder[extension_spot:] >+ remainder[-1] = last_remainder[:extension_spot] >+ request.response_type = mime_type >+ request.response_ext = extension > > notfound_handlers = [] > while True: >-- >1.7.2.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 895562
: 678795