[flutter_image] Add custom request headers.#374
[flutter_image] Add custom request headers.#374stuartmorgan-g merged 16 commits intoflutter:masterfrom
Conversation
1. Change version number to 4.1.0 2. Removed preserveHeaderCase 3. Improved documentation 4. Reversed unit test conditional order
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Sorry for the delay, just a few small nits left.
| const NetworkImageWithRetry(this.url, | ||
| {this.scale = 1.0, | ||
| this.fetchStrategy = defaultFetchStrategy, | ||
| this.requestHeaders}); |
There was a problem hiding this comment.
Nit: please add the trailing comma so the more legible formatting is kept.
| /// values will be used as the header values. A list of header names can | ||
| /// be found at https://datatracker.ietf.org/doc/html/rfc7231#section-8.3 | ||
| /// | ||
| /// Some headers are single valued, and for these, adding a value will |
There was a problem hiding this comment.
This sentence doesn't make sense in the context of this API, which isn't an add.
There was a problem hiding this comment.
Removed this sentence.
| /// the same when converted to lower-case, they are considered to be | ||
| /// the same header, with one set of values. | ||
| /// | ||
| /// Example, adding Basic Authentication to requests. |
There was a problem hiding this comment.
"For example, to add an authorization header to the request:"
There was a problem hiding this comment.
Updated sentence.
| /// Example, adding Basic Authentication to requests. | ||
| /// | ||
| /// final NetworkImageWithRetry subject = NetworkImageWithRetry( | ||
| /// Uri.parse('http://www.flutter.com/top_secret.png'), |
There was a problem hiding this comment.
Nit: Use https if you're showing an example of sending passwords; we shouldn't have examples that demonstrate bad practice.
| /// Example, adding Basic Authentication to requests. | ||
| /// | ||
| /// final NetworkImageWithRetry subject = NetworkImageWithRetry( | ||
| /// Uri.parse('http://www.flutter.com/top_secret.png'), |
There was a problem hiding this comment.
Please ident 2, not 1, in a continuation.
|
@stuartmorgan I've pushed an update, however CI appears to be broken at the moment.
|
I believe this is due to a credential issue that required a fix in the repository, so you'll need to merge in the latest master. |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
One tiny nit, plus you seem to have reformatted the entire file with a different line length, which will need to be undone. LGTM with those changes though.
| /// the same when converted to lower-case, they are considered to be | ||
| /// the same header, with one set of values. | ||
| /// | ||
| /// For example, to add an authorization header to the request. |
There was a problem hiding this comment.
Nit: This should end with :, not ..
This PR adds custom request headers to address issue flutter/flutter#19532.
Pre-launch Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy].CHANGELOG.mdto add a description of the change.///).