Discussion:
[ale] Anyone know about Safari?
Charles Shapiro via Ale
2018-10-02 19:58:11 UTC
Permalink
I have a python 2.7 CGI script using the cgi module running inside
lighttpd on a raspberry pi. It works fine in firefox, chrome, and even the
browser that comes with Windows 10 (edge?). In Safari and konquerer, the
CGI runs fine but the browsers won't render the HTML it prints. Instead,
these two browsers print the output of my script as if it were text. If I
run cgi.test(), they render the HTML correctly. If I purposely mung the
python script ( I have cgitb enabled), the errors render correctly. The
correctly rendered HTML and the HTML rendered as text both appear to lack
headers as shown by view source in all browsers. If I put my cgi-bin
output into a file named "foo.html", it renders correctly in all browsers (
I presume they are deducing that it is HTML by the file extension). If I
put a "Content-Type: text/html" line into my cgi-bin output, then firefox
and others offer to download the output of my script rather than displaying
it ( it has no effect on the behavior of Safari).

The web is silent on this matter. Has anyone here experienced this?
Charles Shapiro via Ale
2018-10-02 20:05:41 UTC
Permalink
Nemmine, solved it. You need two linefeeds after the "Content-Type:" line:

print("Content-Type: text/html\n\n")

Then it works on all browsers. Ugh.

-- CHS
Post by Charles Shapiro via Ale
I have a python 2.7 CGI script using the cgi module running inside
lighttpd on a raspberry pi. It works fine in firefox, chrome, and even the
browser that comes with Windows 10 (edge?). In Safari and konquerer, the
CGI runs fine but the browsers won't render the HTML it prints. Instead,
these two browsers print the output of my script as if it were text. If I
run cgi.test(), they render the HTML correctly. If I purposely mung the
python script ( I have cgitb enabled), the errors render correctly. The
correctly rendered HTML and the HTML rendered as text both appear to lack
headers as shown by view source in all browsers. If I put my cgi-bin
output into a file named "foo.html", it renders correctly in all browsers (
I presume they are deducing that it is HTML by the file extension). If I
put a "Content-Type: text/html" line into my cgi-bin output, then firefox
and others offer to download the output of my script rather than displaying
it ( it has no effect on the behavior of Safari).
The web is silent on this matter. Has anyone here experienced this?
Jim Kinney via Ale
2018-10-02 20:14:15 UTC
Permalink
<doh!>
Post by Charles Shapiro via Ale
print("Content-Type: text/html\n\n")
Then it works on all browsers. Ugh.
-- CHS
On Tue, Oct 2, 2018 at 3:58 PM Charles Shapiro <
Post by Charles Shapiro via Ale
I have a python 2.7 CGI script using the cgi module running inside
lighttpd on a raspberry pi. It works fine in firefox, chrome, and
even the browser that comes with Windows 10 (edge?). In Safari and
konquerer, the CGI runs fine but the browsers won't render the HTML
it prints. Instead, these two browsers print the output of my
script as if it were text. If I run cgi.test(), they render the
HTML correctly. If I purposely mung the python script ( I have
cgitb enabled), the errors render correctly. The correctly rendered
HTML and the HTML rendered as text both appear to lack headers as
shown by view source in all browsers. If I put my cgi-bin output
into a file named "foo.html", it renders correctly in all browsers
( I presume they are deducing that it is HTML by the file
extension). If I put a "Content-Type: text/html" line into my
cgi-bin output, then firefox and others offer to download the
output of my script rather than displaying it ( it has no effect on
the behavior of Safari).
The web is silent on this matter. Has anyone here experienced this?
_______________________________________________Ale mailing
ANNOUNCE and SCHOOLS lists athttp://mail.ale.org/mailman/listinfo
--
James P. Kinney III

Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain

http://heretothereideas.blogspot.com/
Jim Kinney via Ale
2018-10-02 20:33:48 UTC
Permalink
Safari needs longer to recognize "Oh, yeah. That's a new web page I
need to render. Glad I got this blank line of time so I can start my
render engine."
Post by Charles Shapiro via Ale
print("Content-Type: text/html\n\n")
Then it works on all browsers. Ugh.
-- CHS
On Tue, Oct 2, 2018 at 3:58 PM Charles Shapiro <
Post by Charles Shapiro via Ale
I have a python 2.7 CGI script using the cgi module running inside
lighttpd on a raspberry pi. It works fine in firefox, chrome, and
even the browser that comes with Windows 10 (edge?). In Safari and
konquerer, the CGI runs fine but the browsers won't render the HTML
it prints. Instead, these two browsers print the output of my
script as if it were text. If I run cgi.test(), they render the
HTML correctly. If I purposely mung the python script ( I have
cgitb enabled), the errors render correctly. The correctly rendered
HTML and the HTML rendered as text both appear to lack headers as
shown by view source in all browsers. If I put my cgi-bin output
into a file named "foo.html", it renders correctly in all browsers
( I presume they are deducing that it is HTML by the file
extension). If I put a "Content-Type: text/html" line into my
cgi-bin output, then firefox and others offer to download the
output of my script rather than displaying it ( it has no effect on
the behavior of Safari).
The web is silent on this matter. Has anyone here experienced this?
_______________________________________________Ale mailing
ANNOUNCE and SCHOOLS lists athttp://mail.ale.org/mailman/listinfo
--
James P. Kinney III

Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain

http://heretothereideas.blogspot.com/
Scott Castaline via Ale
2018-10-02 20:42:23 UTC
Permalink
Hmm the difference between crank start engines and electric start engines
Post by Jim Kinney via Ale
Safari needs longer to recognize "Oh, yeah. That's a new web page I
need to render. Glad I got this blank line of time so I can start my
render engine."
Nemmine, solved it.  You need two linefeeds after the "Content-Type:"
print("Content-Type: text/html\n\n")
Then it works on all browsers.  Ugh.
-- CHS
On Tue, Oct 2, 2018 at 3:58 PM Charles Shapiro
I have a  python 2.7 CGI script using the cgi module running inside
lighttpd on a raspberry pi.  It works fine in firefox, chrome, and
even the browser that comes with Windows 10 (edge?).  In Safari and
konquerer, the CGI runs fine but the browsers won't render the HTML
it prints.  Instead, these two browsers print the output of my
script as if it were text.  If I run cgi.test(), they render the
HTML correctly. If I purposely mung the python script ( I have cgitb
enabled), the errors render correctly. The correctly rendered HTML
and the HTML rendered as text both appear to lack headers as  shown
by view source in all browsers.  If I put my cgi-bin output into a
file named "foo.html", it renders correctly in all browsers ( I
presume they are deducing that it is HTML by the file extension).  
If I put a "Content-Type: text/html" line into my  cgi-bin output,
then firefox and others offer to download the output of my script
rather than displaying it ( it has no effect on the behavior of
Safari).
The web is silent on this matter.  Has anyone here experienced this?
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
James P. Kinney III
Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain
http://heretothereideas.blogspot.com/
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Sent to you and NSA, CIA, FBI, SS, DHS and GOD only knows who the hell else...
Phil Turmel via Ale
2018-10-03 01:46:21 UTC
Permalink
No, single the blank line between headers and content is part of the
http spec.
Safari needs longer to recognize "Oh, yeah. That's a new web page I need
to render. Glad I got this blank line of time so I can start my render
engine."
Nemmine, solved it.  You need two linefeeds after the "Content-Type:"
print("Content-Type: text/html\n\n")
Then it works on all browsers.  Ugh.
-- CHS
Jim Kinney via Ale
2018-10-03 11:14:21 UTC
Permalink
Joke kill

:-(
Post by Phil Turmel via Ale
No, single the blank line between headers and content is part of the
http spec.
Post by Jim Kinney via Ale
Safari needs longer to recognize "Oh, yeah. That's a new web page I
need
Post by Jim Kinney via Ale
to render. Glad I got this blank line of time so I can start my
render
Post by Jim Kinney via Ale
engine."
Nemmine, solved it.  You need two linefeeds after the
"Content-Type:"
Post by Jim Kinney via Ale
print("Content-Type: text/html\n\n")
Then it works on all browsers.  Ugh.
-- CHS
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Sent from my Android device with K-9 Mail. All tyopes are thumb related and reflect authenticity.
Phil Turmel via Ale
2018-10-03 13:27:28 UTC
Permalink
-EJOKETOOSUBTLE or -EJOKETOOSUBTLEFORME
Post by Jim Kinney via Ale
Joke kill
:-(
No, single the blank line between headers and content is part of the
http spec.
Safari needs longer to recognize "Oh, yeah. That's a new web page I need
to render. Glad I got this blank line of time so I can start my render
engine."
Nemmine, solved it.  You need two linefeeds after the
"Content-Type:"
print("Content-Type: text/html\n\n")
Then it works on all browsers.  Ugh.
-- CHS
------------------------------------------------------------------------
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Sent from my Android device with K-9 Mail. All tyopes are thumb related
and reflect authenticity.
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://ma
Pete Hardie via Ale
2018-10-03 14:38:57 UTC
Permalink
[Error: font spec <Ironic Sans> not found]
Post by Phil Turmel via Ale
-EJOKETOOSUBTLE or -EJOKETOOSUBTLEFORME
Post by Jim Kinney via Ale
Joke kill
:-(
No, single the blank line between headers and content is part of the
http spec.
Safari needs longer to recognize "Oh, yeah. That's a new web
page I need
to render. Glad I got this blank line of time so I can start my render
engine."
Nemmine, solved it. You need two linefeeds after the
"Content-Type:"
print("Content-Type: text/html\n\n")
Then it works on all browsers. Ugh.
-- CHS
------------------------------------------------------------------------
Post by Jim Kinney via Ale
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Sent from my Android device with K-9 Mail. All tyopes are thumb related
and reflect authenticity.
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
Jim Kinney via Ale
2018-10-03 15:14:07 UTC
Permalink
Totally Excellent!
Post by Pete Hardie via Ale
[Error: font spec <Ironic Sans> not found]
Post by Phil Turmel via Ale
-EJOKETOOSUBTLE or -EJOKETOOSUBTLEFORME
Post by Jim Kinney via Ale
Joke kill
:-(
On October 2, 2018 9:46:21 PM EDT, Phil Turmel via Ale <
No, single the blank line between headers and content is part
of the
Post by Jim Kinney via Ale
http spec.
Safari needs longer to recognize "Oh, yeah. That's a new
web
Post by Jim Kinney via Ale
page I need
to render. Glad I got this blank line of time so I can
start my
Post by Jim Kinney via Ale
render
engine."
On Tue, 2018-10-02 at 16:05 -0400, Charles Shapiro via
Nemmine, solved it. You need two linefeeds after the
"Content-Type:"
print("Content-Type: text/html\n\n")
Then it works on all browsers. Ugh.
-- CHS
-------------------------------------------------------------
-----------
Post by Jim Kinney via Ale
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Sent from my Android device with K-9 Mail. All tyopes are thumb
related
Post by Jim Kinney via Ale
and reflect authenticity.
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
James P. Kinney III

Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain

http://heretothereideas.blogspot.com/
Charles Shapiro via Ale
2018-10-03 15:09:14 UTC
Permalink
I am just glad my stupid CGI script works.

-- CHS
Post by Jim Kinney via Ale
Totally Excellent!
[Error: font spec <Ironic Sans> not found]
-EJOKETOOSUBTLE or -EJOKETOOSUBTLEFORME
Post by Jim Kinney via Ale
Joke kill
:-(
No, single the blank line between headers and content is part of the
http spec.
Safari needs longer to recognize "Oh, yeah. That's a new web
page I need
to render. Glad I got this blank line of time so I can start my render
engine."
Nemmine, solved it. You need two linefeeds after the
"Content-Type:"
print("Content-Type: text/html\n\n")
Then it works on all browsers. Ugh.
-- CHS
------------------------------------------------------------------------
Post by Jim Kinney via Ale
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
Sent from my Android device with K-9 Mail. All tyopes are thumb related
and reflect authenticity.
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
James P. Kinney III Every time you stop a school, you will have to build a
jail. What you gain at one end you lose at the other. It's like feeding a
dog on his own tail. It won't fatten the dog. - Speech 11/23/1900 Mark
Twain http://heretothereideas.blogspot.com/
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
James Sumners via Ale
2018-10-06 15:59:00 UTC
Permalink
If the content-type header was the last header in your set of headers, then
that makes sense. Safari is merely strictly adhering to the RFC:

https://tools.ietf.org/html/rfc2616#section-6
"
After receiving and interpreting a request message, a server responds
with an HTTP response message.

Response = Status-Line ; Section 6.1
*(( general-header ; Section 4.5
| response-header ; Section 6.2
| entity-header ) CRLF) ; Section 7.1
CRLF
[ message-body ] ; Section 7.2
"

Note the two "CRLF" sequences following the "entity-header" block.

See https://tools.ietf.org/html/rfc2616#section-2.2 for a definition of
"CRLF".
Post by Charles Shapiro via Ale
print("Content-Type: text/html\n\n")
Then it works on all browsers. Ugh.
-- CHS
Post by Charles Shapiro via Ale
I have a python 2.7 CGI script using the cgi module running inside
lighttpd on a raspberry pi. It works fine in firefox, chrome, and even the
browser that comes with Windows 10 (edge?). In Safari and konquerer, the
CGI runs fine but the browsers won't render the HTML it prints. Instead,
these two browsers print the output of my script as if it were text. If I
run cgi.test(), they render the HTML correctly. If I purposely mung the
python script ( I have cgitb enabled), the errors render correctly. The
correctly rendered HTML and the HTML rendered as text both appear to lack
headers as shown by view source in all browsers. If I put my cgi-bin
output into a file named "foo.html", it renders correctly in all browsers (
I presume they are deducing that it is HTML by the file extension). If I
put a "Content-Type: text/html" line into my cgi-bin output, then firefox
and others offer to download the output of my script rather than displaying
it ( it has no effect on the behavior of Safari).
The web is silent on this matter. Has anyone here experienced this?
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
James Sumners
http://james.sumners.info/ (technical profile)
http://jrfom.com/ (personal site)
http://haplo.bandcamp.com/ (music)
Continue reading on narkive:
Loading...