<s> class UploadPrefixMiddleware ( object ) : <EOL> '''<STR_LIT>''' <EOL> def process_response ( self , request , response ) : <EOL> from django . conf import settings <EOL> from rest_framework . exceptions import PermissionDenied <EOL> from . access_control import upload_prefix_for_request <EOL> cookie_name = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> try : <EOL> response . set_cookie ( cookie_name , upload_prefix_for_request ( request ) ) <EOL> except PermissionDenied : <EOL> response . delete_cookie ( cookie_name ) <EOL> return response </s>
