def get_response(self): tarname = "%s@%s.tar.gz" % (self.context['repo'].name, sanitize_branch_name(self.context['rev'])) headers = { 'Content-Disposition': "attachment; filename=%s" % tarname, 'Cache-Control': "no-store", # Disables browser caching } tar_stream = dulwich.archive.tar_stream( self.context['repo'], self.context['blob_or_tree'], self.context['commit'].commit_time, format="gz") return Response(tar_stream, mimetype="application/x-tgz", headers=headers)
def get_response(self): basename = "%s@%s" % ( self.context["repo"].name, sanitize_branch_name(self.context["rev"]), ) tarname = basename + ".tar.gz" headers = { "Content-Disposition": "attachment; filename=%s" % tarname, "Cache-Control": "no-store", # Disables browser caching } tar_stream = dulwich.archive.tar_stream( self.context["repo"], self.context["blob_or_tree"], self.context["commit"].commit_time, format="gz", prefix=encode_for_git(basename), ) return Response(tar_stream, mimetype="application/x-tgz", headers=headers)
def get_response(self): tarname = "%s@%s.tar.gz" % (self.context['repo'].name, sanitize_branch_name(self.context['rev'])) headers = { 'Content-Disposition': "attachment; filename=%s" % tarname, 'Cache-Control': "no-store", # Disables browser caching } tar_stream = dulwich.archive.tar_stream( self.context['repo'], self.context['blob_or_tree'], self.context['commit'].commit_time, format="gz" ) return Response( tar_stream, mimetype="application/x-tgz", headers=headers )