4080: Redirection to custom Bug URL causes 400 Bad Request

pszalanski
ssengar

What version are you running?

2.5.2

What's the URL of the page containing the problem?

https://our.reviewboard.de/r/12345/

What steps will reproduce the problem?

  1. Configure the repository to have a bug tracker URL like custom:some/path/test?id=%s
  2. Create a review with an associated bug
  3. Try to click the link with the bug ID

What is the expected output? What do you see instead?

I would like my browser to open the link.
Instead I get a site showing "Bad Request (400)"

What operating system are you using? What browser?

Debian Linux 8. Browser is Chrome.

Please provide any additional information below.

The log says

Unsafe redirect to URL with protocol 'custom'
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, callback_args, *callback_kwargs)
File "/usr/local/lib/python2.7/dist-packages/reviewboard/reviews/views.py", line 1636, in bug_url
return HttpResponseRedirect(review_request.repository.bug_tracker % bug_id)
File "/usr/local/lib/python2.7/dist-packages/django/http/response.py", line 459, in init
raise DisallowedRedirect("Unsafe redirect to URL with protocol '%s'" % parsed.scheme)
DisallowedRedirect: Unsafe redirect to URL with protocol 'custom'

I even found a possible solution on Stackoverflow:
http://stackoverflow.com/questions/14558876/django-1-4-redirect-to-non-http-urls

david
#1 david
  • +EasyFix
#2 ssengar
  • +ssengar
david
#3 david

Fixed in release-2.5.x (c44e4a2). This will ship in 2.5.3. Thanks!

  • -New
    +Fixed