File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -246,9 +246,25 @@ cls.NetworkLoggerService = function()
246246 if ( ! ctx )
247247 return ;
248248
249+ // Workaround CORE-47687: UrlFinished is missing for urls resulting in a 301 (Moved Permanently) response
250+ var remove_from_allocated_after_update = false ;
251+ if ( ctx )
252+ {
253+ // Guess what the matching entry is from here. This is normally much harder,
254+ // but we only want to do this workaround in this easy case anyway.
255+ var matching_entry = ctx . get_entries_with_res_id ( data . resourceID ) [ 0 ] ;
256+ if ( matching_entry . events . last &&
257+ matching_entry . events . last . name == "urlredirect" )
258+ {
259+ remove_from_allocated_after_update = true ;
260+ }
261+ }
262+
249263 ctx . update ( "responsefinished" , data ) ;
250- // todo: work around CORE-47687 here too. in case the corresponding entry
251- // has seen a redirect before, it needs to remove the resource id from the allocated list now.
264+
265+ if ( remove_from_allocated_after_update )
266+ delete ctx . allocated_res_ids [ data . resourceID ] ;
267+
252268 } ;
253269 this . _on_responsefinished_bound = this . _on_responsefinished . bind ( this , this . _on_responsefinished ) ;
254270
@@ -1068,7 +1084,7 @@ cls.NetworkLoggerEntryPrototype = function()
10681084
10691085 this . _update_event_urlredirect = function ( event )
10701086 {
1071- // Workaround for CORE-47687
1087+ // Workaround CORE-47687: UrlFinished is missing for urls resulting in a 301 (Moved Permanently) response
10721088 this . _set_is_finished_on_responsefinished = true ;
10731089 } ;
10741090
You can’t perform that action at this time.
0 commit comments