+Support $W->{"header_only"}.
[MyWeb.git] / Web.pm
diff --git a/Web.pm b/Web.pm
index 2ab9c00..dfd4b48 100644 (file)
--- a/Web.pm
+++ b/Web.pm
@@ -647,10 +647,13 @@ my($class)=@_;
        while (my($key,$val)=each(%{$W->{"headers"}})) {
                $W->{"r"}->header_out($key,$val);
                }
-       $W->{"r"}->send_http_header("text/html; charset=$client_charset");      # "Content-type"; do not use header()
+       if (!$W->{"header_only"}) {
+               $W->{"r"}->send_http_header("text/html; charset=$client_charset");      # "Content-type"; do not use header()
+               }
 
        return if $W->{"heading_done"}++;
        exit if $W->{"r"}->header_only();
+       return if $W->{"header_only"};
 
        if (1) { # || !$msie_major || $msie_major>=4) # TODO:dyn
                Wprint '<?xml version="1.0" encoding="'.$client_charset.'"?>'."\n";