diff --git a/mfr/server/handlers/core.py b/mfr/server/handlers/core.py index 68b5cabc6..42f2872ac 100644 --- a/mfr/server/handlers/core.py +++ b/mfr/server/handlers/core.py @@ -1,20 +1,20 @@ -import os import abc -import uuid import asyncio +import os import pkg_resources +import uuid +from raven.contrib.tornado import SentryMixin import tornado.web import tornado.iostream -from raven.contrib.tornado import SentryMixin +import waterbutler.core.exceptions import waterbutler.core.utils import waterbutler.server.utils -import waterbutler.core.exceptions -from mfr.server import settings -from mfr.core.metrics import MetricsRecord from mfr.core import utils, exceptions, remote_logging +from mfr.core.metrics import MetricsRecord +from mfr.server import settings CORS_ACCEPT_HEADERS = [ 'Range', @@ -97,13 +97,15 @@ def NAME(self): async def prepare(self): """Builds an MFR provider instance, to which it passes the the ``url`` query parameter. - From that, the file metadata is extracted. Also builds cached waterbutler providers. + From that, the file metadata is extracted. Also builds cached waterbutler providers. """ + if self.request.method == 'OPTIONS': return try: - self.url = self.request.query_arguments['url'][0].decode('utf-8') + # retrieve the url from request query parameter and append `&mfr=ture` + self.url = self.request.query_arguments['url'][0].decode('utf-8') + '&mfr=true' except KeyError: raise exceptions.ProviderError( '"url" is a required argument.', diff --git a/setup.py b/setup.py index 4fa7a9663..91dd25a85 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,6 @@ def parse_requirements(requirements): 'mfr.exporters': [ # google docs '.gdraw = mfr.extensions.image:ImageExporter', - '.gdoc = mfr.extensions.unoconv:UnoconvExporter', '.gsheet = mfr.extensions.unoconv:UnoconvExporter', '.gslides = mfr.extensions.unoconv:UnoconvExporter', @@ -660,7 +659,6 @@ def parse_requirements(requirements): # google docs '.gdraw = mfr.extensions.image:ImageRenderer', - '.gdoc = mfr.extensions.unoconv:UnoconvRenderer', '.gsheet = mfr.extensions.tabular:TabularRenderer', '.gslides = mfr.extensions.unoconv:UnoconvRenderer', @@ -693,6 +691,7 @@ def parse_requirements(requirements): # pdf '.pdf = mfr.extensions.pdf:PdfRenderer', + '.gdoc = mfr.extensions.pdf:PdfRenderer', # rst '.rst = mfr.extensions.rst:RstRenderer',