Friday 15 April 2011

asp.net - Adding a tag in URL causes 400 Bad Request Error -



asp.net - Adding a <script> tag in URL causes 400 Bad Request Error -

adding tag in url causes 400 bad request error. have redirected users generic error pages created me error occurring on site. using <customerrors> tags in web.config redirect users error occurring on site.

for eg.

http://www.example.com/abc/<script>alert('hi');<script>.aspx -- redirects 400 bad request page

http://www.example.com/abc/frmlogin.aspx?<script>alert('hi');<script> -- redirects custom error page defined in web.config

i have deployed site on iis 5 , on iis 6.

if closely url http://www.example.com/abc/<script>alert('hi');<script>.aspx, means requesting page "something.aspx", why says 400 bad request, not internal server error - http status 500. , why not redirecting custom error page, meant http status 500 - server error. solve this, need handle 400 status , , redirect required page.

more info - https://www.stokia.com/support/misc/web-config-custom-httperrors.aspx

asp.net url http-status-code-404 iis-6 http-status-code-400

No comments:

Post a Comment