Skip to content

Commit

Permalink
feat: Send request url to custom webRequest modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreLeBlond committed Jun 27, 2019
1 parent eb09ac5 commit ce5d042
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions dist/preview release/what's new.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- Added support for sound sprites [Doc](https://doc.babylonjs.com/how_to/playing_sounds_and_music#playing-a-sound-sprite) ([Deltakosh](https://github.com/deltakosh/))
- Display Oculus Quest controller when using a Quest in WebVR ([TrevorDev](https://github.com/TrevorDev))
- Added startAndReleaseDragOnPointerEvents property to pointerDragBehavior which can be set to false for custom drag triggering ([TrevorDev](https://github.com/TrevorDev))
- Added url parameters to web request modifiers ([PierreLeBlond](https://github.com/PierreLeBlond))

### Engine
- Morph targets now can morph UV channel as well ([Deltakosh](https://github.com/deltakosh/))
Expand Down
4 changes: 2 additions & 2 deletions src/Misc/webRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class WebRequest {
/**
* Add callback functions in this array to update all the requests before they get sent to the network
*/
public static CustomRequestModifiers = new Array<(request: XMLHttpRequest) => void>();
public static CustomRequestModifiers = new Array<(request: XMLHttpRequest, url: string) => void>();

private _injectCustomRequestHeaders(): void {
for (let key in WebRequest.CustomRequestHeaders) {
Expand Down Expand Up @@ -126,7 +126,7 @@ export class WebRequest {
*/
public open(method: string, url: string): void {
for (var update of WebRequest.CustomRequestModifiers) {
update(this._xhr);
update(this._xhr, url);
}

// Clean url
Expand Down

0 comments on commit ce5d042

Please sign in to comment.