--- deliantra/server/ext/tcp_http.ext 2012/11/07 01:21:27 1.6 +++ deliantra/server/ext/tcp_http.ext 2012/11/09 00:11:49 1.8 @@ -38,6 +38,7 @@ return "content-type: image/jpeg\015\012" if $_[0] =~ /^......JFIF/s; return "content-type: audio/wav\015\012" if $_[0] =~ /^RIFF/; return "content-type: audio/ogg\015\012" if $_[0] =~ /^OggS/; + return "content-type: text/html\015\012" if $_[0] =~ /^respond ("200 OK", $data, (content_type $data) . $cache_headers); } + } elsif (my $idx = (cf::face::find "res/http$uri") || (cf::face::find "res/http${uri}index.html")) { + # TODO: temp redirect to face itself, for caching, or use etag (shudder) + my $data = cf::face::get_data $idx, 1; + $self->respond ("200 OK", $data, (content_type $data) . $cache_headers); + + } elsif (cf::face::find "res/http$uri/index.html") { + $self->respond ("302 dirslash", "", "location: $uri/\015\012"); + } elsif ($uri eq "/debug") { # for debugging my @body = ""; @@ -121,9 +130,6 @@ %$self = (); - } elsif ($uri eq "/") { - $self->respond ("302 hack", "", "location: http://cvs.schmorp.de/deliantra/html5client/client.html\015\012"); - } else { $self->respond ("404 not found"); }