Ignore observers that are not indicative of demand-matchers.

This commit is contained in:
Tony Garnock-Jones 2018-11-13 20:53:45 +00:00
parent 5d314f01db
commit 32cc933513
1 changed files with 7 additions and 0 deletions

View File

@ -63,6 +63,13 @@ function _server(host, port, httpsOptions) {
}
during Observe(Request(_, server, $method, $pathPattern, _, _)) {
if (typeof method !== 'string' ||
(typeof pathPattern !== 'object' || pathPattern === null ||
typeof pathPattern.toJS !== 'function')) {
// Likely some kind of logging observer.
// TODO: reconsider schema
return;
}
if (method.toLowerCase() !== method) {
console.warn('HTTP method should be lowercase: ' + method);
}