'use strict';
var normalizeObj = require('./normalizeObj');

module.exports = exports = wms;
exports.getCapabilities = require('./capabilities');
exports.getTile = require('./tile');
exports.getMap = require('./map');

function wms (options, rawParams, callback) {
  var params = normalizeObj(rawParams);
  switch(params.request.toLowerCase()) {
    case 'getcapabilities':
      return exports.getCapabilities(options, params, callback);
    case 'getmap':
      return exports.getMap(options, params, callback);
    case 'gettile':
      return exports.getTile(options, params, callback);
    default:
      throw new Error('unknown/invalid request');
  }
}

@@ -298,16 +298,112 @@
 arams);%0A
+  if (typeof params.request !== 'string') %7B%0A    throw new Error('unknown/invalid request');%0A  %7D%0A
   switch

check for request type