> I see, so it looks like some kind of mismatch between chunked and
> non-chunked mode used by the web server and expected by the client
> script. I'll have a look into it. nginx probably messes that up.
I'm not sure whether it is relevant here, but I know of another
If you connect your browser to a PicoLisp application directly, e.g. to
port 8080, and the first button you press is a '+JS' button, then that
first XMLHttpRequest will fail. As the system falls back to a normal
HTTP transfer, and posts the page immediately, the user usually won't
notice it. It is just so that this first transaction takes a little
longer, and you can see on the browser's status bar that it reloads the
This will not happen if 'httpGate' is used. In additions, for most
applications the first button to press is something like "login", which
usually isn't a '+JS' button. So this is not a real problem.
But I was wondering back then, when I implemented the 'form' mechanism,
why this happens. Now I think that it is a security violation problem.
An XMLHttpRequest is allowed to access only the same server where it
originated from. Now when an application listens on port 8080, then the
application session will use it own port (e.g. 8081). The browser seems
to believe that "http://hostname:8080" and "http://hostname:8081" are
different servers. So it issues a security exception, and the HTTP
transfer falls back.
If 'httpGate' is used, all requests from the browser go to port 80, and
the ports are embedded into the URL (http://hostname/8081), so it does
not look like a different server to the browser. Crazy!
> The subsequent button presses just update the chart fields without
> submitting the form and reloading the page. But why does it have to
> submit the form for the first time?
Is it possible we have related problems here?