Skip to content

Commit f059def

Browse files
committed
Updated: FileUploader.prototype._parseHeaders function
1 parent b486a44 commit f059def

File tree

6 files changed

+10
-24
lines changed

6 files changed

+10
-24
lines changed

angular-file-upload.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
angular-file-upload v1.1.2
2+
angular-file-upload v1.1.3
33
https://github.com/nervgh/angular-file-upload
44
*/
55
(function(angular, factory) {
@@ -421,17 +421,10 @@ module
421421

422422
if (!headers) return parsed;
423423

424-
function trim(string) {
425-
return string.replace(/^\s+/, '').replace(/\s+$/, '');
426-
}
427-
function lowercase(string) {
428-
return string.toLowerCase();
429-
}
430-
431424
angular.forEach(headers.split('\n'), function(line) {
432425
i = line.indexOf(':');
433-
key = lowercase(trim(line.substr(0, i)));
434-
val = trim(line.substr(i + 1));
426+
key = line.slice(0, i).trim().toLowerCase();
427+
val = line.slice(i + 1).trim();
435428

436429
if (key) {
437430
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;

angular-file-upload.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

angular-file-upload.min.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-file-upload",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"main": "angular-file-upload.js",
55
"homepage": "https://github.com/nervgh/angular-file-upload",
66
"ignore": ["examples"],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-file-upload",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"homepage": "https://github.com/nervgh/angular-file-upload",
55
"description": "Angular File Upload is a module for the AngularJS framework",
66
"author": {

src/module.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -405,17 +405,10 @@ module
405405

406406
if (!headers) return parsed;
407407

408-
function trim(string) {
409-
return string.replace(/^\s+/, '').replace(/\s+$/, '');
410-
}
411-
function lowercase(string) {
412-
return string.toLowerCase();
413-
}
414-
415408
angular.forEach(headers.split('\n'), function(line) {
416409
i = line.indexOf(':');
417-
key = lowercase(trim(line.substr(0, i)));
418-
val = trim(line.substr(i + 1));
410+
key = line.slice(0, i).trim().toLowerCase();
411+
val = line.slice(i + 1).trim();
419412

420413
if (key) {
421414
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;

0 commit comments

Comments
 (0)