Skip to content

Tags: google/GoogleUtilities

Tags

CocoaPods-8.1.5

Toggle CocoaPods-8.1.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: prep 815 release (#256)

8.1.4

Toggle 8.1.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Harden GULUserDefaults getters and GULNetworkURLSession response hand…

…ling (#252)

* fix(userdefaults): check stored value types in typed getters

The typed getters sent NSNumber selectors (integerValue, boolValue, ...)
to whatever object was stored, so a persisted value of an unexpected type
(e.g. an array or data written from a server response) crashed with an
unrecognized selector. stringForKey:, arrayForKey: and dictionaryForKey:
returned the stored object unchecked, handing callers the wrong type.

Mirror NSUserDefaults: numeric getters accept NSNumber or NSString,
stringForKey: converts an NSNumber to its stringValue, and the collection
getters return nil for other types.

* fix(network): handle non-HTTP responses and nil request URLs

URLSession:task:didCompleteWithError: asserted that the task response is
an NSHTTPURLResponse. The assertion is compiled out of release builds, so
a non-HTTP response (possible when a custom NSURLProtocol intercepts the
request) was cast and passed to callers, who then crash calling
statusCode or allHeaderFields. Replace the assertion with a runtime check
and report a GULErrorCodeNetworkInvalidResponse error instead.

Also avoid inserting a nil request URL into the array literal used to log
a server trust evaluation error.

* fix(logger): look up cached os_log objects by category

GULOSLogBasic stored os_log objects under the category key but looked
them up by subsystem, so the cache never hit and os_log_create ran for
every log message.

* docs(changelog): note userdefaults, network and logger fixes

* fix(network): keep system errors for non-HTTP responses

When a task finished with a non-HTTP response and an error, the error
was replaced with GULErrorCodeNetworkInvalidResponse. Pass the more
specific system error through and only create an invalid-response error
when there is none.

Also fall back to the task's original request URL when logging a server
trust evaluation error, so the log still names the host if _request is
unset.

CocoaPods-8.1.4

Toggle CocoaPods-8.1.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Harden GULUserDefaults getters and GULNetworkURLSession response hand…

…ling (#252)

* fix(userdefaults): check stored value types in typed getters

The typed getters sent NSNumber selectors (integerValue, boolValue, ...)
to whatever object was stored, so a persisted value of an unexpected type
(e.g. an array or data written from a server response) crashed with an
unrecognized selector. stringForKey:, arrayForKey: and dictionaryForKey:
returned the stored object unchecked, handing callers the wrong type.

Mirror NSUserDefaults: numeric getters accept NSNumber or NSString,
stringForKey: converts an NSNumber to its stringValue, and the collection
getters return nil for other types.

* fix(network): handle non-HTTP responses and nil request URLs

URLSession:task:didCompleteWithError: asserted that the task response is
an NSHTTPURLResponse. The assertion is compiled out of release builds, so
a non-HTTP response (possible when a custom NSURLProtocol intercepts the
request) was cast and passed to callers, who then crash calling
statusCode or allHeaderFields. Replace the assertion with a runtime check
and report a GULErrorCodeNetworkInvalidResponse error instead.

Also avoid inserting a nil request URL into the array literal used to log
a server trust evaluation error.

* fix(logger): look up cached os_log objects by category

GULOSLogBasic stored os_log objects under the category key but looked
them up by subsystem, so the cache never hit and os_log_create ran for
every log message.

* docs(changelog): note userdefaults, network and logger fixes

* fix(network): keep system errors for non-HTTP responses

When a task finished with a non-HTTP response and an error, the error
was replaced with GULErrorCodeNetworkInvalidResponse. Pass the more
specific system error through and only create an invalid-response error
when there is none.

Also fall back to the task's original request URL when logging a server
trust evaluation error, so the log still names the host if _request is
unset.

8.1.3

Toggle 8.1.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release version 8.1.3 (#246)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

CocoaPods-8.1.3

Toggle CocoaPods-8.1.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Release version 8.1.3 (#246)

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

8.1.2

Toggle 8.1.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: bump podspec versiona and add changelog note (#241)

CocoaPods-8.1.2

Toggle CocoaPods-8.1.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
chore: bump podspec versiona and add changelog note (#241)

8.1.1

Toggle 8.1.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update podspec for 8.1.1 (#231)

CocoaPods-8.1.1

Toggle CocoaPods-8.1.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update podspec for 8.1.1 (#231)

8.1.0

Toggle 8.1.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
[Release] Add changelog and bump podspec bump following #220 (#222)