Skip to content

Commit

Permalink
throw error when the combo url is too long. close seajs#230
Browse files Browse the repository at this point in the history
  • Loading branch information
lifesinger committed Jun 26, 2012
1 parent cb3b951 commit f456d77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion dist/plugin-combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,14 @@ define('seajs/plugin-combo', function() {
util.forEach(paths, function(path) {
var root = path[0] + '/'
var parts = path[1]
var comboPath = root + comboSyntax[0] + parts.join(comboSyntax[1])

var hash = {}
var comboPath = root + comboSyntax[0] + parts.join(comboSyntax[1])

// http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url
if (comboPath.length > 2000) {
throw new Error('The combo url is too long: ' + comboPath)
}

util.forEach(parts, function(part) {
hash[root + part] = comboPath
Expand Down
8 changes: 7 additions & 1 deletion src/plugins/plugin-combo.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,14 @@ define('seajs/plugin-combo', function() {
util.forEach(paths, function(path) {
var root = path[0] + '/'
var parts = path[1]
var comboPath = root + comboSyntax[0] + parts.join(comboSyntax[1])

var hash = {}
var comboPath = root + comboSyntax[0] + parts.join(comboSyntax[1])

// http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url
if (comboPath.length > 2000) {
throw new Error('The combo url is too long: ' + comboPath)
}

util.forEach(parts, function(part) {
hash[root + part] = comboPath
Expand Down

0 comments on commit f456d77

Please sign in to comment.