Apache 在 OPTIONS 方法中不返回允许标头

Apache 在 OPTIONS 方法中不返回允许标头

我尝试从 Apache 服务器获取允许标头。我使用 curl 发送了请求。服务器返回标头,但没有返回“header allow”标头:

$ curl -v -X OPTIONS 10.0.0.1
* Rebuilt URL to: 10.0.0.1/
* Hostname was NOT found in DNS cache
*   Trying 10.0.0.1...
* Connected to 10.0.0.1 (10.0.0.1) port 80 (#0)
> OPTIONS / HTTP/1.1
> User-Agent: curl/7.37.0
> Host: 10.0.0.1
    > Accept: */*
> 
< HTTP/1.1 200 OK
< Date: Sun, 15 Jun 2014 07:35:24 GMT
* Server Apache/2.2.22 (Ubuntu) is not blacklisted
    < Server: Apache/2.2.22 (Ubuntu)
< X-Powered-By: PHP/5.3.10-1ubuntu3.7
< Vary: Accept-Encoding
< Content-Length: 1498
< Content-Type: text/html
< 

我找不到设置标题的选项。

答案1

我可以Allow在虚拟主机节中手动添加标头:

<VirtualHost ...>
...
Allow: GET,POST,PUT,DELETE,OPTIONS
...
</VirtualHost>

从 Chrome 开发者工具中:

...
Allow:GET, POST, PUT, DELETE, OPTIONS
...

相关内容