[extensions-web/wip/shell-version: 1/2] extensions: respond with bad request when invalid Shell version is passed
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web/wip/shell-version: 1/2] extensions: respond with bad request when invalid Shell version is passed
- Date: Wed, 6 Jul 2022 18:02:51 +0000 (UTC)
commit e34ec0f4a17df56165899677721256d5f1095056
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Wed Jul 6 21:58:49 2022 +0400
extensions: respond with bad request when invalid Shell version is passed
sweettooth/extensions/views.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 1594ec8..4e71621 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -115,7 +115,10 @@ def find_extension_version_from_params(extension, params):
def shell_download(request, uuid):
extension = get_object_or_404(models.Extension.objects.visible(), uuid=uuid)
- version = find_extension_version_from_params(extension, request.GET)
+ try:
+ version = find_extension_version_from_params(extension, request.GET)
+ except models.InvalidShellVersion:
+ return HttpResponseBadRequest()
if version is None:
raise Http404()
@@ -440,7 +443,11 @@ def ajax_details_view(request):
else:
raise Http404()
- version = find_extension_version_from_params(extension, request.GET)
+ try:
+ version = find_extension_version_from_params(extension, request.GET)
+ except models.InvalidShellVersion:
+ return HttpResponseBadRequest()
+
return ajax_details(extension, version)
@ajax_view
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]