ASP.NET MVC Head Verb and Selenium RC

Selenium (RC) is used to test ASP.NET 1.1 site.

When we make a request via Selenium RC (which, in turn, automates the request via a configured browser - in this case Firefox), the http verb "HEAD". We have several action methods on a form that have separate GET and POST methods, decorated with AcceptVerbs (HttpVerbs.Get) or HttpVerbs.Post respectively. These methods return 404 and log an "open action could not be found" error message.

Questions:

  • When writing separate Get / Post methods, what is the best way to handle the head verb? Should we always decorate AcceptVerbs (HttpVerbs.Get | HttpVerbs.Head)?

  • Why is a HEAD verb generated when Selenium RC automates the browser instead of the If-Modified-Since header?

  • We've also seen log entries from (non-mainstream) scanners that use the HEAD verb. We created robots.txt entries to prevent these crawlers from indexing the site, but now we're wondering what is the best SEO practice. Is it important to respond to HEAD for scanners? Do they have conventional scanners? Does it affect SEO rankings?

+2


a source to share


1 answer


  • Yes, I think that whenever you restrict your requests to GET only, you should always allow HEAD on them - in fact, I think it should be built into the MVC framework (next thing on my to-do list: raise the issue in the MVC bug tracker so that the [HttpGet] attribute must somehow support the HEAD verb)
  • I would like to know the answer too. In the meantime, the suggested workaround is pass 'true' as the second parameter to Selenium open ().
  • I don't think this affects the SERP as such, however I can see crawlers not requesting a full page if HEAD gives 404. According to the HTTP specification ( RFC2616 ): "The HEAD method is identical to GET, except that the server MUST NOT return a message body in response ", so if you do everything right it shouldn't be a problem to allow this method and avoid accessing them.


+3


a source







All Articles