Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting 'service' and 'version' from request parameters #31

Open
cklein05 opened this issue Aug 14, 2014 · 2 comments
Open

Deleting 'service' and 'version' from request parameters #31

cklein05 opened this issue Aug 14, 2014 · 2 comments

Comments

@cklein05
Copy link
Contributor

In all request entry functions, notably 'call' in wsgi.py and modserver.py and 'process' in cgiserver.py, you delete 'service' and 'version' parameters from reqparams. However, in the exception handler you get the version from reqparams in order to determine whether to create a 1.1.1 or a 1.3.0 exception. Since 'version' has been deleted, you end up constantly returning 1.1.1 exceptions even if VERSION=1.3.0 was specified on the request.

Since I do not see any problems with having both 'service' and 'version' in reqparams around, I recommend NOT deleting these entries after the service handler was setup. If you agree, I will include this in one of my upcoming pull requests (likely in the XML-prettifying PR).

@manelclos
Copy link
Member

Hi Carsten,

the version is first passed to ServiceHandlerFactory, which will parse the version string. It looks servicehandler.processParameters function will not fail if version is present in reqparams.

Sure this can be simpler, so If you want to improve that code please use a different branch and PR. Of course code modification means adding tests, so maybe it is not worth it at this time, maybe in a bigger refactor.

        servicehandler = ServiceHandlerFactory(self.conf, self.mapfactory, onlineresource, reqparams.get('version', None))
        if reqparams.has_key('version'):
            del reqparams['version']
        if request not in servicehandler.SERVICE_PARAMS.keys():
            raise OGCException('Operation "%s" not supported.' % request, 'OperationNotSupported')
        ogcparams = servicehandler.processParameters(request, reqparams)

@cklein05
Copy link
Contributor Author

Hi Manel,

yes, as said previously, I will likely include a fix for NOT removing the 'version' (and, for the sake of consistency, for NOT removing the 'request') in one of my next PRs. I think it best fits into the PR for XML pretty-printing, XML namespace optimization etc. for both capabilities and service exception XML files coming up next.

Carsten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants