• 
      

    Modernize hostingsvcs.service.URLRequest

    Review Request #8909 — Created April 21, 2017 and submitted

    Information

    Review Board
    release-2.5.x

    Reviewers

    The URLRequest initializer was using a mutable object ({}) for its
    default value of its headers parameter, which would persist to other
    requests if it was modified. We now use a default value of None and
    change it to an empty dict in the method call.

    Documentation has been added for the class and its methods.

    Built the docs and read through them.
    Ran unit tests.

    Description From Last Updated

    I don't think we need to use literals for HTTP GET/POST.

    chipx86chipx86

    "URL"

    chipx86chipx86

    Can simplify with: super(...).__init__(..., headers or {})

    chipx86chipx86

    Actually, hold on. Request is an old-style class that can't be used with super.

    daviddavid
    chipx86
    1. 
        
    2. reviewboard/hostingsvcs/service.py (Diff revision 1)
       
       
      Show all issues

      I don't think we need to use literals for HTTP GET/POST.

    3. reviewboard/hostingsvcs/service.py (Diff revision 1)
       
       
      Show all issues

      "URL"

    4. reviewboard/hostingsvcs/service.py (Diff revision 1)
       
       
       
       
       
      Show all issues

      Can simplify with:

      super(...).__init__(..., headers or {})
      
    5. 
        
    brennie
    david
    1. Ship It!
    2. 
        
    david
    1. 
        
    2. reviewboard/hostingsvcs/service.py (Diff revision 2)
       
       
      Show all issues

      Actually, hold on. Request is an old-style class that can't be used with super.

    3. 
        
    brennie
    brennie
    david
    1. Ship It!
    2. 
        
    brennie
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-2.5.x (0723f45)