text/plain、text/html 的未知格式异常;接受 header
Unknown Format exception with text/plain,text/html; Accept header
接受 header "Accept: text/plain,text/html;"
适用于像 http://nginx.org 这样的网站。然而,当我 运行 它在本地针对我的 Rails 4.1 应用
curl -v -H "Accept: text/plain,text/html;" localhost:3000/
在 html 响应主页上,我收到一个 ActionController::UnknownFormat
执行的 500 错误页面。
当我卷曲时
curl -v -H "Accept: text/plain,text/html" localhost:3000
一切正常(注意缺少的 ;
)
如何让它也适用于 Accept: text/plain,text/html;
案例?
显然,根据 RFC 7231,它的格式不正确,不应该工作。 nginx.org 返回 200 OK
甚至对于明显格式错误的 MIME 类型也是如此。
接受 header "Accept: text/plain,text/html;"
适用于像 http://nginx.org 这样的网站。然而,当我 运行 它在本地针对我的 Rails 4.1 应用
curl -v -H "Accept: text/plain,text/html;" localhost:3000/
在 html 响应主页上,我收到一个 ActionController::UnknownFormat
执行的 500 错误页面。
当我卷曲时
curl -v -H "Accept: text/plain,text/html" localhost:3000
一切正常(注意缺少的 ;
)
如何让它也适用于 Accept: text/plain,text/html;
案例?
显然,根据 RFC 7231,它的格式不正确,不应该工作。 nginx.org 返回 200 OK
甚至对于明显格式错误的 MIME 类型也是如此。