Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed; do not assume content-type is present [reported by c4milo]

  • Loading branch information...
commit 3ea89775f5ba3fa541371e5bf77a9df4ac836e20 1 parent 0cf2aee
TJ Holowaychuk visionmedia authored

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +4 2 lib/connect-form.js
6 lib/connect-form.js
@@ -73,11 +73,13 @@ module.exports = function(options){
73 73 */
74 74
75 75 function formRequest(req) {
  76 + var contentType = req.headers['content-type'];
  77 + if (!contentType) return;
76 78 return req.body === undefined
77 79 && (req.method === 'POST'
78 80 || req.method === 'PUT')
79   - && (~req.headers['content-type'].indexOf('multipart/form-data')
80   - || ~req.headers['content-type'].indexOf('urlencoded'));
  81 + && (~contentType.indexOf('multipart/form-data')
  82 + || ~contentType.indexOf('urlencoded'));
81 83 }
82 84
83 85 /**

0 comments on commit 3ea8977

Please sign in to comment.
Something went wrong with that request. Please try again.