Re: CGI and euc
- Posted by useless_ Jan 14, 2013
- 2373 views
CoJaBo2 said...
HTTP/1.0 200 OKCGI is not HTTP; This should be:
Status: 200 OK
According to me and O'Reilly, the CGI script is perfectly within it's limits to make a complete HTTP header to send to the httpd. Technically, HTTP/1.0 is obsolete, and yet people still use it. And while i am mentioning O'Reilly, here's a quote from one of his books:
print "$server_protocol 200 OK", "\n"; print "Server: $server_software", "\n"; print "Content-type: text/plain", "\n\n"; print "OK, Here I go. I am going to count from 1 to 50!", "\n";Note the lack of \r at the end of header lines or between the header and the body. This is why i say Euphoria should be adaptive or smart when parsing headers, and not enforce the rules du jour. Basically, whatever the first line ends with, that's what you are going to get as a line/header terminator, and i don't care if it's "right" or not, it's what is.
CoJaBo2 said...
There should be a space after the semicolon in headers:
Content-Type: text/javascript
Any number of spaces, even, from RFC2616: "The field value MAY be preceded by any amount of LWS, though a single SP is preferred.". Use only one to make CoBaJo happy.
CoJaBo2 said...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">HTML Transitional has been obsolete for quite a number of years; Use HTML5- <!DOCTYPE html>
This site uses Transitional, so does my site. If the page is compliant to what's stated, and you simply change that header, your page is likely not compliant to HTML5 and will display wrong.
CoJaBo2 said...
<script src="http://localhost:8088/cgi/suck.exe?argument=nothing particular" type="text/javascript"></script>Spaces aren't valid in URLs; encode them as + or %20.
I have links such as
<a href="canoe pontoons.html">and they work fine. The browser handles it. It's not illegal to have spaces until the space is actually sent to the server to get a page or post data. As general good programmng style, you should encode just prior to sending, as a single point in the program, for everything (not in the page body) being sent, else you could have a program flow bug where the url gets encoded twice. I've seen it happen.
And by the way, i also will object to http.e transparently following redirects, perhaps i don't want to goto the new url, the programmer should see the redirect and decide yes/no to send the new url to http.e for a second fetch.
useless