twitter/CocoaSPDY — pull request #50 by kgoodier (2014-06-18 01:22:31+00:00)
Title: URL encode the path

NSURL's path property returns the path in non-escaped form per Apple's documentation and our observations. For instance:

```objc
NSURL *url = [[NSURL alloc] initWithString:@"https://example.com/foo/%E9%9F%B3%E6%A5%BD.json"];
// actual url.path: "foo/音楽.json"
// desired url.path: "foo/%E9%9F%B3%E6%A5%BD.json"
```

Note the query and fragment properties return their values in escaped form.

The SPDY spec says the ":path" header value must be a valid conforming URL, which means it should be percent-escaped. This change is the best fix I could find for all iOS clients. iOS 7+ has a NSURLComponents class that makes all of this much easier and more explicit.