The problem is that WSGI is based around the CGI specification. Thus WSGI applications are only effectively meant to use:
SCRIPT_NAME PATH_INFO QUERY_STRING The rules of CGI for parsing of the URL specification lay down how these are created and one aspect of that is the struct interpretation of what a ? mark in the URL means. Specifically, a ? mark is the separate between the path component of the URL and any query string parameters. So, Apache (not mod_wsgi) uses that interpretation and will break up the URL to create those CGI variables which mod_wsgi then takes and passes in the WSGI environ dictionary. The result is that the first ? mark, or duplicates if more than one in a row, will vanish. So in a WGSI world you are going to have trouble doing what you want and keep within the WSGI specification. That said, the original raw URL resource is available in REQUEST_URI for some WSGI servers, but a conforming WSGI application is not meant to use it. The problem with REQUEST_URI is that it is the raw value. It has not had any URL escape decoding, or path normalisation done which the underlying web server may do. It isn't therefore necessarily easy or reliable to try and do comparisons between PATH_INFO and REQUEST_URI to try and extract additional information out of REQUEST_URI such as these question marks. In some servers such as Apache where mod_rewrite can be used to internally remap URLs, the REQUEST_URI may not even resemble at all what the WSGI application is given. In summary, your ARK syntax does not fit within the CGI query string interpretation of URLs that WSGI uses. To support that URL formatting convention and adhere to the WSGI specification isn't going to be possible. You may be able to hack something up by also consulting REQUEST_URI, but that is not WSGI conforming. Graham On 4 April 2013 10:55, John Kozura <[email protected]> wrote: > Currently my group has a Django server set up on Ubuntu 8, using Apache, > Django, Python and mod_python. We are planning to set up a new server to > replace this one. The new server will be running updated versions of the > software the current server is running. > For example, Ubuntu 12 will be used, Django will be updated from 1.3 to 1.5, > and Python will be updated to 2.6 or 2.7 > One thing that will change is that instead of mod_python, we will be using > mod_wsgi. This is largely due to the fact that as of version 1.5, Django has > removed mod_python support, instead using mod_wsgi > (https://docs.djangoproject.com/en/1.5/internals/deprecation/#id2). > The problem is that we are using the ARK naming scheme, and have had problems > with the ARK syntax and mod_wsgi in the past. Here is some info about ARK: > > *An ARK is a special kind of URL that connects users to > three things: the named object, its metadata, and the provider's > promise about its persistence. When entered into the location field > of a Web browser, the ARK leads the user to the named object. That > same ARK, inflected by appending a single question mark (`?'), > returns a brief metadata record that is both human- and machine- > readable. When the ARK is inflected by appending dual question marks > (`??'), the returned metadata contains a commitment statement from > the current provider.* > > Here is the ARK specification page, where the info above came from: > (https://wiki.ucop.edu/download/attachments/16744455/arkspec.txt?version=1&modificationDate=1261036800000) > > In the past, mod_wsgi was not accepting the trailing **?** or **??** > characters, which are integral to the ARK specification. I have searched for > hours and can't seem to determine if support has been added for these > characters in mod_wsgi, or if some workaround will need to be implemented. > > Please let me know if you know about this, or if you need any other > information from me. > Thanks in advance, > John > > -- > You received this message because you are subscribed to the Google Groups > "modwsgi" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/modwsgi?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
