Skip to content

Commit c211eab

Browse files
committed
bug fix
1 parent 3fda7ea commit c211eab

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

django_project_base/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
urlpatterns = [
1616
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
17-
path('browser-update/js-script', browser_update_script, name='browser-update-script'),
17+
re_path('browser-update/js-script', browser_update_script, name='browser-update-script'),
1818
re_path(r'', include(django_project_base_router.urls)),
1919
]

django_project_base/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ def browser_update_script(request: object) -> HttpResponse:
1414
script: str = request.path.split('js-script')[-1].strip('/')
1515
except Exception:
1616
script: str = ''
17+
script = script or 'update.min.js'
1718
http_response: HttpResponse = HttpResponse(
18-
requests.get('https://browser-update.org/%s' % script or 'update.min.js', verify=False).content.decode(),
19+
requests.get('https://browser-update.org/%s' % script, verify=False).content.decode(),
1920
content_type='application/javascript',
2021
)
2122
return http_response

0 commit comments

Comments
 (0)