text file attachments in gnatsweb corrupted on Windows

Jo A Wahle <[email protected]> Mon, 12 Jun 2006 10:09:10 -0500
Newsgroups gmane.comp.bug-tracking.gnats.general
Message-ID <OF61119C85.16038E2E-ON8625718B.00533B8E-8625718B.00533D1B@usgs.gov>
In gnatsweb, when a user attaches a .txt file from a Windows machine, it 
gets converted automatically to UNIX line-endings when it is saved in the 
PR. When a user downloads the file (still on Windows), it's not getting 
converted back. I tried to change download_attachments to do:

[...]
  print_header(-type => $ctype,
[...]

where $ctype is what I extracted from $$hash_ref{'Content-Type'}, but it 
still isn't converting the line-endings. (I even tried setting $ctype 
directly to 'text/plain' in case I had incorrectly parsed 
$$hash_ref{'Content-Type'} but I got the same result.) It doesn't matter 
which browser I use. I tried changing it to 'text/html' and it 
automatically tried to open the file in a browser instead of in Notepad, 
so it is picking up on that header.

Has anyone else encountered this? I don't know a lot about the http 
headers or how & when it's converting the line-endings, but I can't see 
that the gnatsweb.pl code is doing the line-ending conversion, so it must 
have something to do with the http code, right?

--
Jo Wahle, Software Engineer, Engineering Support, SAIC
(Science Applications International Corporation ? www.saic.com)
Contractor to U.S. Geological Survey ? EROS, Sioux Falls SD 57198
 (Earth Resources Observation and Science ? eros.usgs.gov)

_______________________________________________
Help-gnats mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnats