urbanadventurer/WhatWeb — Issue #62: ASP.NET plugin causes error when logging to Mongo
Author: coffeetocode
Created: 2012-01-05 20:16:54+00:00
State: open

Hitting a site that triggers the ASP.NET plugin causes an error when logging to mongo, due to the "." in the plugin name. Changing it to ASPDOTNET fixes that. I'm staging a pull request that impliments that.

(for the run below I've added code to print the error and backtrace to whatweb.rb)

$ whatweb --aggression 1 --log-mongo-database test --log-mongo-collection whatwebtest --log-mongo-host localhost http://msn.com
http://msn.com [301] Charset[ASCII], HTTPServer[Microsoft-IIS/6.0], ASP.NET, RedirectLocation[http://www.msn.com/], UncommonHeaders[s], IP[65.55.206.203], X-Powered-By[ASP.NET], Microsoft-IIS[6.0], Title[Document Moved], Country[UNITED STATES][US]
Error: Logging failed for http://msn.com ASP.NET - key must not contain '.'

["/var/lib/gems/1.8/gems/bson-1.5.2/lib/bson/bson_c.rb:24:in `serialize'",
"/var/lib/gems/1.8/gems/bson-1.5.2/lib/bson/bson_c.rb:24:in `serialize'",
"/var/lib/gems/1.8/gems/mongo-1.5.2/lib/mongo/collection.rb:940:in `insert_documents'",
"/var/lib/gems/1.8/gems/mongo-1.5.2/lib/mongo/collection.rb:939:in `each'",
"/var/lib/gems/1.8/gems/mongo-1.5.2/lib/mongo/collection.rb:939:in `insert_documents'",
"/var/lib/gems/1.8/gems/mongo-1.5.2/lib/mongo/collection.rb:343:in `insert'", "/home/ubuntu/malware_factors/tools/whatweb/whatweb-0.4.7/lib/output.rb:669:in `out'",
"whatweb/whatweb-0.4.7/whatweb:1306", "whatweb/whatweb-0.4.7/whatweb:1304:in `each'",
"whatweb/whatweb-0.4.7/whatweb:1304", "whatweb/whatweb-0.4.7/whatweb:1213:in `initialize'",
"whatweb/whatweb-0.4.7/whatweb:1213:in `new'", "whatweb/whatweb-0.4.7/whatweb:1213"]