Skip to content

Commit

Permalink
Fix nullability of Obj-C header manipulation
Browse files Browse the repository at this point in the history
Fixes #67.
  • Loading branch information
lilyball committed Nov 27, 2019
1 parent 41ba62f commit 9697a9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,10 @@ work by you shall be dual licensed as above, without any additional terms or con
#### Development

* Add Obj-C convenience functions for creating upload requests with an `NSData` but no explicit `contentType` ([#65][]).
* Fix the Obj-C `-setValue:forHeaderField:` and `-setValue:forDefaultHeaderField:` methods to take a nullable value ([#67][]).

[#65]: https://github.com/postmates/PMHTTP/issues/65 "Obj-C convenience functions for requests with data"
[#67]: https://github.com/postmates/PMHTTP/issues/67 "Obj-C -[HTTPManagerRequest setValue:forHeaderField:] should take nullable value"

#### v4.4.3 (2019-11-14)

Expand Down
8 changes: 4 additions & 4 deletions Sources/ObjectiveC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ extension HTTPManager {

/// Sets a specified default HTTP header field.
///
/// - Parameter value: The value for the header field.
/// - Parameter value: The value for the header field. If `nil` the header is deleted.
/// - Parameter field: The name of the header field. Header fields are case-insensitive.
@objc(setValue:forDefaultHeaderField:)
public func __objc_setValue(_ value: String, forDefaultHeaderField field: String) {
public func __objc_setValue(_ value: String?, forDefaultHeaderField field: String) {
defaultHeaderFields[field] = value
}

Expand Down Expand Up @@ -790,9 +790,9 @@ extension HTTPManagerRequest {

/// Sets a specified HTTP header field.
///
/// - Parameter value: The value for the header field.
/// - Parameter value: The value for the header field. If `nil` the header is deleted.
/// - Parameter field: The name of the header field. Header fields are case-insensitive.
@objc(setValue:forHeaderField:) public func __objc_setValue(_ value: String, forHeaderField field: String) {
@objc(setValue:forHeaderField:) public func __objc_setValue(_ value: String?, forHeaderField field: String) {
headerFields[field] = value
}

Expand Down

0 comments on commit 9697a9a

Please sign in to comment.