Fix login popup on cross-realm authenticated content previews

We were serving 401s on /user_uploads when the user wasn't authenticated (due to
it being a REST endpoint).  This was causing a login popup to display instead of
just a broken image preview.

(imported from commit 62640f5bd59eb3b86ab5aae5923ccfa742459805)
This commit is contained in:
Zev Benjamin
2014-10-29 17:01:15 -07:00
committed by Zev Benjamin
parent 9c4764fe68
commit f63ee86730
2 changed files with 4 additions and 3 deletions

View File

@@ -163,8 +163,7 @@ urlpatterns += patterns('zerver.views',
url(r'^api/v1/external/freshdesk$', 'webhooks.api_freshdesk_webhook'),
url(r'^api/v1/external/zendesk$', 'webhooks.api_zendesk_webhook'),
url(r'^user_uploads/(?P<realm_id>(\d*|unk))/(?P<filename>.*)', 'rest_dispatch',
{'GET': 'get_uploaded_file'}),
url(r'^user_uploads/(?P<realm_id>(\d*|unk))/(?P<filename>.*)', 'get_uploaded_file'),
)
# JSON format views used by the redesigned API, accept basic auth username:password.