Skip to content

Tags: hathway/JSONRequest

Tags

v0.10.10

Toggle v0.10.10's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #66 from hathway/dependabot/bundler/git-1.18.0

0.10.9

Toggle 0.10.9's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #56 from hathway/spm

Add SPM support

v0.10.9

Toggle v0.10.9's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Merge pull request #56 from hathway/spm

Add SPM support

0.7.0

Toggle 0.7.0's commit message

Verified

This tag was signed with the committer’s verified signature.
dev4dev Alex Antonyuk
Release 0.7.0

swift3.1

Toggle swift3.1's commit message
(HWAYNN-1106)|Fix encoding of URL query parameters (#17)

Summary
--

Apple's implementation of query parameters in `URLComponents` does not
encode all characters that need to be escaped according to RFC 3986
(https://www.ietf.org/rfc/rfc3986.txt, page 12)

The popular Alamofire networking library handles this problem by manually
encoding query parameters. Because this library is battle-tested, I
copied its URL encoding code, modifying it only slightly. (It's `encode`
function accepts a URLRequest as input and returns a modified
URLRequest. Our implementation accepts and returns an updated `URL`.)

An additional win is that Alamofire's implementation properly encodes
arrays and dictionaries into URL query strings.

Tests
--

**Adds two tests:**
- Encoding basic URL parameters (aka "hello=world")
- Encoding URL parameters that need escaping (&'()*+,;=:#[]@)

**Removes one test:**

There was a test asserting that creating a `URL` from an empty string
would return a non-nil `URL`, with an absolute string value of `""`.
This is NOT the behavior when using the `URL(string:)` initializer, but IS
the behavior when initializing through `URLComponents`, which yields:
`URLComponents(string "")!.url == ""`.

This behavior is certainly unexpected, and it's really strange the
original author (Eneko) chose to test for this behavior, especially when
the tested method returns an optional `URL`: `func createURL(urlString:, queryParams:) -> URL?`.

This might be a (odd) breaking change for client code, but because the
intention is to tag this version 1.0, not compatible with previous
versions, this feels appropriate.

0.5.0

Toggle 0.5.0's commit message
Travis-CI and Danger support (#11)

* Adding travis config files
* Adding DANGER

0.4.0

Toggle 0.4.0's commit message