def resolve(self, uri):
if uri.startswith('s3://'):
contents = self.get_s3_uri(uri)
else:
# TODO: in the case of file: content and untrusted
# third parties, uri would need sanitization
fh = urlopen(uri)
contents = fh.read().decode('utf-8')
fh.close()
self.cache.save(("uri-resolver", uri), contents)
return contents
评论列表
文章目录