为什么当我的 DirectoryIndex 指向 Perl CGI 脚本时我不需要 Content-type

问题描述 投票:0回答:0

我这样更改了 mods-available/dir.conf 文件:

DirectoryIndex /cgi-bin/csv_auth

csv_auth
这是一个 Perl CGI 脚本,我有这个:

    print "Content-type: text/html; charset=utf-8\n\n";
    print "<!DOCTYPE html>\n";
    print "<html>\n";
    print "<body>\n";
    print "<h3>Hello you are logged in $user</h3>\n";

然后我的浏览器显示:

Content-type: text/html; charset=utf-8
Hello you are logged in marcos

它不应该显示

Content-type
但它确实显示了。这是否意味着当我的初始页面是 Perl CGI 时我不需要
Content-type
行?

谢谢!

html perl apache2 cgi directoryindex
© www.soinside.com 2019 - 2024. All rights reserved.