Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#475 closed defect (fixed)

Trac 0.12 API Change Breaks Builds

Reported by: jhampton Owned by: osimons
Priority: major Milestone: 0.6
Component: General Version: dev
Keywords: Cc:
Operating System: Linux

Description

In 0.12, an API change (see: tracd and HTTP/1.1) breaks the build master. When a slave connects, an exception is raised due to the API change.

The issue is that the Content-Length header is now required when sending data directly via the Request.

The following patch looks for the Content-Length header and sets it if it doesn't already exist, before sending data.

  • bitten/master.py

     
    138138        """ Formats and sends the response, raising ``RequestDone``. """
    139139        req.send_response(code)
    140140        headers = headers or {}
     141        content_length_present = False
    141142        for header in headers:
    142143            req.send_header(header, headers[header])
     144            if 'content-length' == header.lower():
     145                content_length_present = True
     146            continue
     147        if not content_length_present:
     148            req.send_header('Content-Length', len(body))
     149
    143150        req.write(body)
    144151        raise RequestDone

While this won't be necessary until Trac 0.12 hits the scene, it is a change that should be considered for 0.6 (and 0.11 support) as it's a good idea to make sure that the Content-Length header is set, even though Trac doesn't require it.

Attachments (0)

Change History (3)

comment:1 Changed 15 years ago by osimons

  • Milestone changed from 0.7 to 0.6
  • Owner set to osimons

Good points. Should be fixed.

comment:2 Changed 15 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [778]. Will merge to 0.6 soon.

comment:3 Changed 14 years ago by pipern

This was actually fixed in [779], typo on the previous comment.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.