Hi Gustaf,

Thank you for the example and the info in thread:
https://openacs.org/forums/message-view?message_id=4268249#msg_4268538

Your test case works so I'll debug the legacy scripts.



Still, static files are returned without a content-type value, and without content.

The ns_param allowstaticresources does not change this, whether omitted, or set to true or false. For example, if allowstaticresources is true, and content/file is:

test6.txt
==================================================================
Hello World

==================================================================

or any *.gif or *.png file.

Static content is returned as expected when not in cgi-bin.


The legacy perl cgi scripts I'm testing produce the same results ie no content and no content type, which is why I decided to test static files.


For static content, the log shows errors like:

Debug(cgi): nscgi: interp '(null)' exec '/usr/local/cgi-bin/test6.txt'
Error: exec /usr/local/cgi-bin/test4.txt: execve() failed: Unknown error 1275110264 Debug(cgi): nscgi: execute cgi script in directory '/usr/local/cgi-bin' returned pid -3
Error: waitpid(-3) failed: No child processes
Error: nscgi: wait for /usr/local/cgi-bin/test4.txt failed: No child processes

..when debug logging is invoked nscgi in section of config.tcl using:

ns_logctl severity Debug(pl) on
ns_logctl severity Debug(cgi) on


cheers,
Ben

On 3/1/19 2:29 AM, Gustaf Neumann wrote:

On 28.02.19 21:59, Ben Brink via naviserver-devel wrote:

Is there a way to set a default mime-type for nscgi similar to how other naviserver modules use the default mime-types associated by file suffix, or in any other way, or have I goofed the config?

With 4.99.18 and these settings, no mime-type is provided. Browsers aren't recognizing such content and nscgi isn't sending the content in these cases as far as I can tell.

cgi-scripts have to provide the content type.

Here is a very short example, where one can verify via browser developer
tools, that the server sends the provided content type correctly (when
browsing to "..../hello-word.cgi".

Do you see different results?

-gn


hello-world.cgi
The case you provide
==================================================================
puts "HTTP/1.0 200 OK
Date: Monday, 06-Nov-95 17:50:15 GMT
Content-Type: text/html

<html>
<body>
Hello World
</body>
"
==================================================================


config snippet
==================================================================
# CGI
#
ns_section "ns/server/${server}/module/nscgi" {
     ns_param map     "GET  /*.cgi"
     ns_param Interps  cgi
}

ns_section "ns/interps/cgi" {
     ns_param .cgi "/usr/local/ns/bin/tclsh"
}
==================================================================



_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel



_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to