fix: webRequest should be able to modify CORS headers (#21099)

* fix: always use extraHeaders mode

* fix: clear pending callbacks

* fix: do not use "extraHeaders" for net module

* test: webRequest should be able to modify CROS headers

* chore: CROS => CORS

Co-Authored-By: Milan Burda <milan.burda@gmail.com>

* chore: CROS => CORS

Co-Authored-By: Milan Burda <milan.burda@gmail.com>
This commit is contained in:
Cheng Zhao 2019-11-14 14:51:24 +09:00 committed by GitHub
parent af1e8a347e
commit b02a20e4dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 6 deletions

View file

@ -332,6 +332,10 @@ void WebRequest::OnCompleted(extensions::WebRequestInfo* info,
HandleSimpleEvent(kOnCompleted, info, request, net_error);
}
void WebRequest::OnRequestWillBeDestroyed(extensions::WebRequestInfo* info) {
callbacks_.erase(info->id);
}
template <WebRequest::SimpleEvent event>
void WebRequest::SetSimpleListener(gin::Arguments* args) {
SetListener<SimpleListener>(event, &simple_listeners_, args);