I am trying to use WSAPI on top of mini-httpd and for some reason the
CGI env variables are nil in the script.  However I tested with a perl
script above mini-httpd and obtained the following:

 

SERVER_NAME --> localhost

REMOTE_ADDR --> ::1

LD_LIBRARY_PATH --> /usr/local/lib:/usr/lib

SERVER_PROTOCOL --> HTTP/1.0

REQUEST_METHOD --> GET

SCRIPT_FILENAME --> /usr/share/mini-httpd/html/cgi-bin/perlenv.perl

PATH --> /usr/local/bin:/usr/ucb:/bin:/usr/bin

GATEWAY_INTERFACE --> CGI/1.1

SERVER_SOFTWARE --> mini_httpd/1.19 19dec2003

HTTP_HOST --> localhost

HTTP_USER_AGENT --> Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10)
Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10

SERVER_PORT --> 80

 

The perl script:

#!/usr/bin/perl

print "Content-type: text/html\n\n";

foreach $key (keys %ENV) {

 

print "$key --> $ENV{$key}<br>";

 

}

 

So it seems that the issue is not with mini-httpd but maybe my wsapi
configuration.  Here is the wsapi script I am trying to run:

#!/usr/bin/env wsapi.cgi

 

module("hello", package.seeall)

 

function run(wsapi_env)

  local headers = { ["Content-type"] = "text/html" }

 

  local function hello_text()

    coroutine.yield("<html><body>")

    coroutine.yield("<p>Hello Wsapi!</p>")

    coroutine.yield("<p>PATH_INFO: " .. wsapi_env.PATH_INFO .. "</p>")

    coroutine.yield("<p>SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME ..
"</p>")

    coroutine.yield("</body></html>")

  end

 

  return 200, headers, coroutine.wrap(hello_text)

end

 

return _M

 

Thx

_______________________________________________
Kepler-Project mailing list
Kepler-Project@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/kepler-project
http://www.keplerproject.org/

Reply via email to