Custom CGIs

Opher Shachar ophers at ladpc.co.il
Mon Dec 18 11:45:40 PST 2006


Hello all,

> > Opher Shachar wrote:
> > > Hello,
> > > I created a custom CGI and placed it in /usr/share/cups/doc.
> > > One functionality of the CGI is to send back files:
> > > I write to stdout:
> > >      Content-type: text/plain; charset=<either of utf-8 or iso-8859-8>
> > > or
> > >      Content-type: application/postscript
> > >      Content-length: <file size>
> > >
> > > Then the file (I leave an extra newline after the headers) but on the browser side I see a blank page and eventually timeout.
> > > (It all works fine when sending text/html content)
> > >
> > > Q: Does CUPS support anything but text/html from its CGIs?
> >
> > Yes, of course.  You can't set the content-length, however - CUPS does
> > that for you...
>
> I created this plaintext.cgi file on two machines: one running CUPS 1.1.22 the other 1.2.7
> (/etc/cups/cgi.types contains this single line: application/x-httpd-cgi cgi)
> ---------------- plaintext.cgi start ----------------
> #!/bin/sh
> ############################################
> # This is a test shell script for CUPS
> ############################################
> alias echo='echo -e'
> echo 'Content-type: text/plain'
> echo
> echo 'This is a specially crafted plain text document.'
> ----------------  plaintext.cgi end  ----------------
> It ran OK on CUPS 1.1.22 but NOT on 1.2.7 !!

Can anyone with CUPS 1.2.7 installed please try to reproduce the above?
(I'm not at liberty to uninstall and reinstall CUPS on that machine, nor do I have an auxiliary machine.)

Thanks in advance,
Opher Shachar.





More information about the cups mailing list