Edgewall Software

Ticket #8153: 8153-mainnav-fix-r7956.patch

File 8153-mainnav-fix-r7956.patch, 1.1 KB (added by rblank, 3 years ago)

Patch fixing both issues.

  • trac/web/chrome.py

    diff --git a/trac/web/chrome.py b/trac/web/chrome.py
    a b  
    484484                    href = category_section.get(name + '.href') 
    485485                    if href: 
    486486                        if href.startswith('/'): 
    487                             href = req.href() + href 
     487                            href = req.href().rstrip('/') + href 
    488488                        if label: 
    489489                            item = tag.a(label) # create new label 
    490490                        elif not item: 
  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    a b  
    181181                        target = req.path_info.rstrip('/').encode('utf-8') 
    182182                        if req.query_string: 
    183183                            target += '?' + req.query_string 
    184                         req.redirect(req.href() + target, permanent=True) 
     184                        req.redirect(req.href().rstrip('/') + target, 
     185                                     permanent=True) 
    185186                    raise HTTPNotFound('No handler matched request to %s', 
    186187                                       req.path_info) 
    187188