Access: gain access to the browser screen.

While running tests with compiled CGI executables, I couldn't get text in the browser screen in a reliable way. So I had to revert to:

and the result is what you see below (and can retrieve from the download section). This program is plain simple, but it is also very important. It shows that if you need to output n lines to the screen, you need to send n+2 lines!

Access: the source.

      
MODULE access;

FROM  InOut   IMPORT  WriteString, WriteLn;

BEGIN
   WriteString ("Content-Type : text/plain");
   WriteLn;
   WriteLn;
   WriteString ("Hi there, this is my text.");
   WriteLn
END access.
   
If you want to see what it does, just run this file

You can also run it locally, if you have installed the program in the cgi-bin of your Apache webserver: see it run local. The program runs but it takes ages. Which is strange since it used to run immediately. There's something fishy with apachy.

Apache bug undocumented feature

Look at the following two lines of code:

WriteString ("Content-Type : text/plain");			WriteString ("Content-Type: text/plain");
One gives an internal server error and the other one does not. Can you guess which one fails?

In the good old days, neither version would issue an error condition. Nowadays, as of 2017, the one on the right refuses to run. You get an 'Error 500' and a mentioning in /var/log/httpd/error.log:

[Sat Dec 05 18:31:23.578414 2020] [http:error] [pid 1029:tid 2860514112] [client 127.0.0.1:42328] AH02429: Response
header name 'Content-Type ' contains invalid characters, aborting request, referer: http://localhost/jan/test/access.html
   
One lousy space between 'Type' and the colon ':' suddenly is reason to go completely ape.

Access: how it's invoked.

Below is part of the HTML source to enable you to see these magnificant words on screen.

     <font bgcolor="#FFFFFF">
      If you want to see what it does, just
      <a href="https://verhoeven272.nl/cgi-bin/access" target="_blank">run this file</a>
     </font>
   
But if you have it in your cgi-bin you can also run it by typing this into the URL bar:
http://localhost/cgi-bin/access

Remember: localhost is NOT an https server! So if you try to run the CGI from https://localhost/cgi-bin/access you get a "Failed to connect" error.

Page created in 2004,