sagemath/sagecell — Issue #259: Twisted web server causes URL parameters to be interpreted incorrectly
Author: ihanson
Created: 2012-03-02 21:05:37+00:00
State: open

When the web server is started using Twisted, a URL with a query like `?a%26b=c` is incorrectly processed by Twisted, causing the URL to be passed to Flask with the query `?a&b=c` (i.e. two parameters named `a` and `b`, with `b` having a value of `c`) rather than the original, escaped string. If Flask were receiving the URL correctly, it would process it as a _single_ parameter named `a&b` with a value of `c`. This can be confirmed by adding a function like

```python
@app.route("/test")
def test():
return str(request.args)
```
to web_server.py. The URL will appear differently depending on whether or not the server is running through Twisted.

This has an effect on the ``c=``-style permalinks for user code such as this:

```python
print "Peanut butter & jelly"
```
The permalink generation works when not using Twisted, but does not work when Twisted is running. My modification to web_server.py in 4dfd20a (pull request gh-258) fixes it when running Twisted, but breaks it when not.