Web Serving Observations and Issues

Actually, in Panorama X they are not.

In PanSTAR and up to Panorama 6 the raw web request was passed to Panorama, and Panorama code was used to parse the request into individual items (the URL, post parameters, etc.). However this isn’t really an ideal task for Panorama code, even more so now that Unicode is supported. So in Panorama X, all of that parsing is actually done in Objective-C code inside PanoramaX.cgi. The CGI parses all of the information into a dictionary that is passed to Panorama X Server, all ready to go. This is much faster, and also ensures that the encoding issues are handled correctly.

Actually, there is also another reason for this – there are possibly two web servers involved, the built in GCDWebServer, or Apache/Nginx/Abyss. So this system ensures that everything works the same no matter which of these servers is used.

So here is an undocumented secret – the cgiPostParameters variable you discovered does contain all of the parameters, but it is not text, but rather a Panorama dictionary. It contains all of the form items, but as dictionary items rather than embedded into a text string. All the necessary parsing and encoding has already been taken care of. This is where the webformitem functions get the information. If you enable logging of the post parameters, that is done by using the dumpdictionaryquoted( function.

Remember, the entire previous paragraph is an undocumented secret. So I’m not going to promise that it will never change. The proper way to access these items is using the webformitem functions.

As it turns out, Panorama X has a function that takes a dictionary and turns it into encoded http post data. So I think there is a quick hack you could use to get your code working again. Just put this line at the top of any procedure that needs the cgiParameters variable.

letglobal cgiParameters = encodehttppostdata(cgiPostParameters)

Now this is kind of a wasteful solution, performance wise. But I suppose if you are saving it into a text file you won’t care if it takes a couple of extra milliseconds to parse, unparse, and then reparse this data.

I forgot those popup menus were even there! I guess there must be a bug, I’ve logged it.

For what it’s worth, I never use those logs for debugging any more. It’s so much nicer and more useful to use the new instrumentation feature. Especially since then I can enable the output for only the code I am working on at the moment. The new instrumentation feature is way better than sliced bread for working on server code.