ID:111307
 
Not a bug
BYOND Version:480
Operating System:Linux
Web Browser:Firefox 3.6.16
Applies to:DMCGI
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND Developer forums.
Descriptive Problem Summary:

I was getting this message as infrequent "spam" in my DMCGI error logs:
CGI Error: unexpected HTTP request method: HEAD
BUG: Aborting CGI

Since first noticing the error, I've included a methods check
if(GetEnv(REQUEST_METHOD) == "HEAD")
to divert head requests.
(diverted to avoid calling GetEnv(HTTP_COOKIE) or returning <body></body>). Anyway, this seems to have solved the crashes, but...

Expected Results: Since the error message isn't internal to Dantom.CGI, I would expect the crash report to tell me where it crashed and why.

Does the problem occur:
Every time? Or how often? prior to my fix, every time a HEAD request was received, as far as I could tell
In other games? error present in logs of all DMCGI websites I run
On other computers? also occurred on previous server

Workarounds: This isn't a critical issue; however, it does spam the logs with errors that are difficult to track down.


edit:

Actually, I'm still getting the same "CGI Error"s, though apparently less frequently.
The message is generated from BYOND internally. I don't think your workaround code can work because the hard-coded error should trigger before that. You're probably seeing the error less frequently because whatever misbehaving crawler (one assumes) was sending you those requests has mostly moved on.
I was wondering about that, but I figured if that was the case, you'd let me know. Should I make this a feature request then?
I think it's safe to leave this in bugs for now. HEAD requests are common enough that we probably want to at least return something basic or blank.
I get the impression that HEAD requests are only useful for bots/crawlers, but that alone might make it useful for development. For example, giving developers the option to use the
if(GetEnv(REQUEST_METHOD) == "HEAD")
approach could help boost search engine optimization.
This is more in the realm of a feature request so I'm closing the bug report.