Skip to content

Commit 5043437

Browse files
committed
Tidy up formatting for phaserjs#2585
1 parent 495cbb7 commit 5043437

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
319319

320320
### New Features
321321

322-
*
322+
* The Loader has a new property `headers`. This is an object checked by XHR Requests, used to set the Request Header of certain file types. JSON and XML are pre-configured, but you can add to, or modify this property as required (thanks @stoneman1 #2585 #2485)
323323
*
324324
*
325325

@@ -328,7 +328,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
328328
* TypeScript definitions fixes and updates (thanks)
329329
* Docs typo fixes (thanks @drhayes @)
330330
* The TilemapParser will now add more data when importing Image object types from Tiled. The extra data available is: image width, image height, and flags to see if the image is flipped either horizontally, vertically or diagonally (thanks @gotenxds #2564 #2554)
331-
*
331+
* TilemapLayer.renderRegion has had an assignment to the obsolete `tileColor` property removed (thanks @cryptographer #2583)
332332

333333
### Bug Fixes
334334

src/loader/Loader.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ Phaser.Loader = function (game) {
102102
*/
103103
this.path = '';
104104

105-
/**
106-
* @property {object} Headers - Maps file types to accept headers.
107-
* @default
108-
*/
109-
105+
/**
106+
* Used to map the application mime-types to to the Accept header in XHR requests.
107+
* If you don't require these mappings, or they cause problems on your server, then
108+
* remove them from the headers object and the XHR request will not try to use them.
109+
* @property {object} headers
110+
* @default
111+
*/
110112
this.headers = {
111113
json: "application/json",
112114
xml: "application/xml"
@@ -2327,7 +2329,11 @@ Phaser.Loader.prototype = {
23272329
var xhr = new XMLHttpRequest();
23282330
xhr.open("GET", url, true);
23292331
xhr.responseType = type;
2330-
if (this.headers[file.type]) { xhr.setRequestHeader("Accept", this.headers[file.type]); }
2332+
2333+
if (this.headers[file.type])
2334+
{
2335+
xhr.setRequestHeader("Accept", this.headers[file.type]);
2336+
}
23312337

23322338
onerror = onerror || this.fileError;
23332339

0 commit comments

Comments
 (0)