Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#12451 closed defect (fixed)

Error reports are not directed to trac-hacks.org if home_page or url attribute starts with https

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 0.12.8
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed error reports not sent to trac-hacks.org if home_page or url attribute uses HTTPS protocol.

API Changes:
Internal Changes:

Description

The issue is due to use of startswith to compare against the string http://trac-hacks.org: tags/trac-0.12.7/trac/web/main.py@:586,612#L578.

Proposed change:

  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index ee7b0bb..9808ecf 100644
    a b from pprint import pformat, pprint  
    3131import re
    3232import sys
    3333import traceback
     34from urlparse import urlparse
    3435
    3536from genshi.builder import tag
    3637from genshi.output import DocType
    def send_internal_error(env, req, exc_info):  
    670671            faulty_plugins.sort(key=lambda p: p['frame_idx'])
    671672            if faulty_plugins:
    672673                info = faulty_plugins[0]['info']
     674                home_page = info.get('home_page', '')
    673675                if 'trac' in info:
    674676                    tracker = info['trac']
    675                 elif info.get('home_page', '').startswith(th):
     677                elif urlparse(home_page).netloc == urlparse(th).netloc:
    676678                    tracker = th
    677679                    plugin_name = info.get('home_page', '').rstrip('/') \
    678680                                                           .split('/')[-1]

Patch was created against the trunk. I will need to test it for 1.0-stable and 0.12-stable.

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 8 years ago

In [14717], .netloc attribute is available since Python 2.6. For 1.0-stable and 0.12-stable, we should use urlparse(home_page)[1] instead.

comment:2 by Ryan J Ollos, 8 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Committed to 0.12-stable in [14717,14718], merged to 1.0-stable in [14719], merged to trunk in [14720].

CI tests will fail on 0.12 branch unless we pin the Pygments version.

Version 0, edited 8 years ago by Ryan J Ollos (next)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.