Exemple #1
0
 def _threadDoGETJob( self, request ):
     
     self._checkBandwidth( request )
     
     # no permissions check as any functional account can get updates
     
     update_hash = request.parsed_request_args[ 'update_hash' ]
     
     if not self._service.HasUpdateHash( update_hash ):
         
         raise HydrusExceptions.NotFoundException( 'This update hash does not exist on this service!' )
         
     
     path = ServerFiles.GetFilePath( update_hash )
     
     response_context = HydrusServerResources.ResponseContext( 200, mime = HC.APPLICATION_OCTET_STREAM, path = path )
     
     return response_context
Exemple #2
0
 def _threadDoGETJob( self, request ):
     
     self._checkBandwidth( request )
     
     # no permission check as any functional account can get files
     
     hash = request.parsed_request_args[ 'hash' ]
     
     ( valid, mime ) = HG.server_controller.Read( 'service_has_file', self._service_key, hash )
     
     if not valid:
         
         raise HydrusExceptions.NotFoundException( 'File not found on this service!' )
         
     
     path = ServerFiles.GetFilePath( hash )
     
     response_context = HydrusServerResources.ResponseContext( 200, mime = mime, path = path )
     
     return response_context