Skip to content

Commit

Permalink
Handle cases where no type is set but the form contains an input fiel…
Browse files Browse the repository at this point in the history
…d with the name "method". Fixes blueimp#2585
  • Loading branch information
blueimp committed Sep 11, 2013
1 parent ac5adc6 commit b4cc566
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/jquery.fileupload.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery File Upload Plugin 5.32.5
* jQuery File Upload Plugin 5.32.6
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -534,8 +534,10 @@
options.url = options.form.prop('action') || location.href;
}
// The HTTP request method must be "POST" or "PUT":
options.type = (options.type || options.form.prop('method') || '')
.toUpperCase();
options.type = (options.type ||
($.type(options.form.prop('method')) === 'string' &&
options.form.prop('method')) || ''
).toUpperCase();
if (options.type !== 'POST' && options.type !== 'PUT' &&
options.type !== 'PATCH') {
options.type = 'POST';
Expand Down

0 comments on commit b4cc566

Please sign in to comment.