Merge pull request #143 from lbryio/sandbox-displayed-files

prevent lbry files opened through the ui from making api calls
This commit is contained in:
Jack Robison 2016-08-28 01:28:56 -04:00 committed by GitHub
commit d9ece5e96a

View file

@ -255,6 +255,7 @@ class LBRYFileStreamer(object):
self._request.setResponseCode(206) self._request.setResponseCode(206)
self._request.setHeader('accept-ranges', 'bytes') self._request.setHeader('accept-ranges', 'bytes')
self._request.setHeader('content-type', self._content_type) self._request.setHeader('content-type', self._content_type)
self._request.setHeader("Content-Security-Policy", "sandbox")
self.resumeProducing() self.resumeProducing()
@ -339,6 +340,7 @@ class HostedLBRYFile(resource.Resource):
# return d # return d
def render_GET(self, request): def render_GET(self, request):
request.setHeader("Content-Security-Policy", "sandbox")
if 'name' in request.args.keys(): if 'name' in request.args.keys():
if request.args['name'][0] != 'lbry' and request.args['name'][0] not in self._api.waiting_on.keys(): if request.args['name'][0] != 'lbry' and request.args['name'][0] not in self._api.waiting_on.keys():
d = self._api._download_name(request.args['name'][0]) d = self._api._download_name(request.args['name'][0])