Ticket #1014 (closed issue: fixed)

Opened 11 years ago

Last modified 10 years ago

WPS use of semicolon in QUERY_STRING incompatible with Python urlparse.parse_qsl()

Reported by: spascoe Owned by: spascoe
Priority: desirable Milestone:
Component: COWS Version:
Keywords: Cc:

Description (last modified by spascoe) (diff)

Issue

WPS 1.0 uses ";" as a separator with the value of a key/value pair. E.g

http://...?key=val1;val2&key2=val3

A little-known recommendation in HTML 4 is that ";" should be synonymous with "&" as a kvp separator ( here). Python 2.5+ implements this within cgi.parse_qsl() / urlparse.parse_qsl() and therefore Pylons and COWS won't parse WPS-1.0 KVP-encoded requests properly.

Suggested Response

  1. Implement a work-around in cows.ows_controller.OWSController._loadOWSParams()
  2. Make WPS community aware of this problem.
  3. Suggest Python community that ";" handling could be switched on/off. Not necessary because escaping ";" is the preferred solution.

Change History

comment:1 Changed 11 years ago by spascoe

  • Status changed from new to assigned
  • Description modified (diff)

Simon Cox passed this ticket on to the WPS editor

comment:2 Changed 11 years ago by spascoe

  • Description modified (diff)

Peter Schut has pointed out that the KVP values should be URL-encoded and therefore ";" will be excaped. However, the WPS-1.0 spec shows examples where this is not done therefore the spec is missleading.

I think that escaping is the obvious solution and I expect the spec will change to reflect this. Therefore suggesting a change to python isn't necessary. We may need a work arround though to account for incompatible clients. This is in SVN now but needs testing [4572].

comment:3 Changed 10 years ago by spascoe

  • Status changed from assigned to closed
  • Resolution set to fixed

This was fixed in [4572] but has since been made optional to maintain backward compatibility for DCIP.

It introduced a problem where you could no longer use HTTP POST to send a form-encoded request. Thissort of POST isn't part of the OGC specs but is required by the UKCP portal. Therefore the old and new behaviour is now controlled by a switch in the paster ini file:

cows.parameter_mode = html_4 => old behaviour where POST is supported but ';' is interpreted against WPS-1.0 cows.parameter_mode = wps_1 => POST is not supported.

If ommited this option defaults to 'html_4'

Note: See TracTickets for help on using tickets.