Updated response header
This commit is contained in:
parent
26c39effec
commit
85a5c45a13
4 changed files with 4 additions and 4 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
## 8.2.0
|
||||
|
||||
* Add `responseHeader` to `AngelHttp` to add headers to HTTP default response
|
||||
* Add `addResponseHeader` to `AngelHttp` to add headers to HTTP default response
|
||||
* Add `removeResponseHeader` to `AngelHttp` to remove headers from HTTP default response
|
||||
|
||||
## 8.1.1
|
||||
|
|
|
@ -84,7 +84,7 @@ class AngelHttp extends Driver<HttpRequest, HttpResponse, HttpServer,
|
|||
}
|
||||
|
||||
/// Add headers to HTTP Response
|
||||
void responseHeader(Map<String, Object> headers) {
|
||||
void addResponseHeader(Map<String, Object> headers) {
|
||||
headers.forEach((key, value) {
|
||||
server?.defaultResponseHeaders.add(key, value);
|
||||
});
|
||||
|
|
|
@ -41,7 +41,7 @@ void main() {
|
|||
}, skip: true);
|
||||
|
||||
test('Add Response Header', () async {
|
||||
http.responseHeader({
|
||||
http.addResponseHeader({
|
||||
'X-XSRF_TOKEN':
|
||||
'a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e'
|
||||
});
|
||||
|
|
|
@ -283,7 +283,7 @@ class Runner {
|
|||
|
||||
// Only apply the headers to AngelHttp instance
|
||||
if (driver is AngelHttp) {
|
||||
driver.responseHeader(args.options.responseHeaders);
|
||||
driver.addResponseHeader(args.options.responseHeaders);
|
||||
driver.removeResponseHeader(args.options.removeResponseHeaders);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue