#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
138 138 """ Formats and sends the response, raising ``RequestDone``. """ 139 139 req.send_response(code) 140 140 headers = headers or {} 141 content_length_present = False 141 142 for header in headers: 142 143 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 143 150 req.write(body) 144 151 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
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.
Good points. Should be fixed.