#2531: Reconstruction of absolute URL fails in a proxy setup
-----------------------------+----------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |        Owner:  jonas   
     Type:  defect           |       Status:  reopened
 Priority:  high             |    Milestone:  0.9.5   
Component:  general          |      Version:  0.9.3   
 Severity:  major            |   Resolution:          
 Keywords:                   |  
-----------------------------+----------------------------------------------
Changes (by cmlenz):

  * summary:  adding attachment to ticket or wiki produces attachment
              KeyError => Reconstruction of absolute URL
              fails in a proxy setup
  * status:  closed => reopened
  * resolution:  worksforme =>
  * priority:  normal => high
  * milestone:  => 0.9.5

Old description:

> checked that user running trac (www) has write access to the attchments
> folder.
>
> {{{
> Traceback (most recent call last):
>   File "/usr/local/lib/python2.4/site-packages/trac/web/standalone.py",
> line 303, in _do_trac_req
>     dispatch_request(path_info, req, env)
>   File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line
> 139, in dispatch_request
>     dispatcher.dispatch(req)
>   File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line
> 107, in dispatch
>     resp = chosen_handler.process_request(req)
>   File "/usr/local/lib/python2.4/site-packages/trac/attachment.py", line
> 265, in process_request
>     self._do_save(req, attachment)
>   File "/usr/local/lib/python2.4/site-packages/trac/attachment.py", line
> 295, in _do_save
>     upload = req.args['attachment']
>   File "/usr/local/lib/python2.4/cgi.py", line 559, in __getitem__
>     raise KeyError, key
> KeyError: 'attachment'
>
> }}}

New description:

 ''(ticket changed direction somewhat since original submission, see
 below)''

 checked that user running trac (www) has write access to the attchments
 folder.

 {{{
 Traceback (most recent call last):
   File "/usr/local/lib/python2.4/site-packages/trac/web/standalone.py",
 line 303, in _do_trac_req
     dispatch_request(path_info, req, env)
   File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line
 139, in dispatch_request
     dispatcher.dispatch(req)
   File "/usr/local/lib/python2.4/site-packages/trac/web/main.py", line
 107, in dispatch
     resp = chosen_handler.process_request(req)
   File "/usr/local/lib/python2.4/site-packages/trac/attachment.py", line
 265, in process_request
     self._do_save(req, attachment)
   File "/usr/local/lib/python2.4/site-packages/trac/attachment.py", line
 295, in _do_save
     upload = req.args['attachment']
   File "/usr/local/lib/python2.4/cgi.py", line 559, in __getitem__
     raise KeyError, key
 KeyError: 'attachment'

 }}}

Comment:

 This issue has come up a number of times again, and I think I finally know
 the culprit now: we shouldn't be trying to extract the `X-Forwarded-Host`
 header and use that for reconstructing the absolute URL. The proxy (e.g.
 `mod_proxy_http`) actually '''expects''' the host name of the original
 machine, and will replace that with it's own host name.

 We'll include the simple fix for this in [milestone:0.9.5].

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2531>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to