【发布时间】:2022-01-20 11:19:09
【问题描述】:
作为标题,由于urlpatterns设置了数字参数,我倾向于认为HttpResponseRedirect不会受到xss攻击,对吗?
如果不是,HttpResponseRedirect 是如何受到影响的?
urls.py
from django.urls import path
from hello import views
app_name = 'hello'
urlpatterns = [
path("", views.home, name="home"),
# ex: /hello/5/
path('<int:question_id>/', views.detail, name='detail'),
path('<int:question_id>/results/', views.results, name='results'),
]
views.py
def detail(request, question_id):
return HttpResponseRedirect(reverse('hello:results', args=(question.id,)))
【问题讨论】:
标签: python django security xss checkmarx