Skip to content

Commit

Permalink
docs: add a few inline clarifications (#85)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Rebello <[email protected]>
Signed-off-by: JP Simard <[email protected]>
  • Loading branch information
rebello95 authored and jpsim committed Nov 28, 2022
1 parent 72abd17 commit b2c1bb2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mobile/examples/objective-c/hello_world/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#pragma mark - ResponseValue

/// Represents a response from the server.
@interface ResponseValue : NSObject
@property (nonatomic, strong) NSString* body;
@property (nonatomic, strong) NSString* serverHeader;
Expand Down Expand Up @@ -84,6 +85,7 @@ - (void)handleResponse:(NSHTTPURLResponse*)response data:(NSData*)data {
return;
}

// Deserialize the response, which will include a `Server` header set by Envoy.
ResponseValue* value = [ResponseValue new];
value.body = body;
value.serverHeader = [[response allHeaderFields] valueForKey:@"Server"];
Expand Down
1 change: 1 addition & 0 deletions mobile/examples/swift/hello_world/ResponseValue.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// Represents a response from the server.
struct Response {
let body: String
let serverHeader: String
Expand Down
1 change: 1 addition & 0 deletions mobile/examples/swift/hello_world/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ final class ViewController: UITableViewController {

NSLog("Response:\n\(data.count) bytes\n\(body)\n\(headers)")

// Deserialize the response, which will include a `Server` header set by Envoy.
let value = Response(body: body, serverHeader: headers["Server"] ?? "")
DispatchQueue.main.async {
self.responses.append(value)
Expand Down

0 comments on commit b2c1bb2

Please sign in to comment.