internet-explorer - Play Framework Internet Explorer 解析器错误

标签 internet-explorer playframework html-parsing

For request 'POST /' [Error parsing application/x-www-form-urlencoded]

我只在 IE 上遇到这个错误。所有其他浏览器都可以处理它而不会哭泣。试图谷歌这个错误,但找不到任何有用的东西。知道应该怎么做才能避免它吗?也许我在框架的一般使用中可能做错了一些我不知道的事情?

最佳答案

我在 IE10 上遇到了同样的情况,我将其追溯到 POST 内容:

 email=fred@example.com&password=asd&=

最后的“&=”导致 FormUrlEncodedParser 异常,在 BodyParsers.tolerantFormUrlEncoded 中被吞并转换为 BadRequest。

总而言之,据我了解,这是两个错误的组合:

  • 无论出于何种原因,MSIE10 都在发送这两个字符(似乎有多种可能的原因)。

  • Play 不容忍查询字符串中的那些无用字符(服务器应用程序通常应忽略 URL 中的未知参数)。我已将此报告为错误:https://github.com/playframework/Play20/issues/1185

在我的例子中,“无论什么原因”是一个没有“名称”属性的标签。在 GafrieldKlon 的例子中,它是一个未封闭的 <input type="hidden"。你的可能是另一个。

关于internet-explorer - Play Framework Internet Explorer 解析器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13914481/

相关文章:

android - 如何检查在android中的Jsoup html解析器中是否存在标签

json - Htmlparser2 解析以获取链接,然后解析这些链接(node.js)

html - 表格在 Internet Explorer 中的 div 中不对齐

Javascript:IE8 中变量对象属性问题的参数无效

html - 即 : dropdown options are blank if contain character of my custom font

internet-explorer - 如何在不设置 DOCTYPE 的情况下在 Firefox 和 Chrome 中选择文档模式?

java - Play 2 JPA Oracle - 即使 ebeanEnabled 在 build.scala 中设置为 false,也会出现额外列 'ebean_intercept'

playframework - 如何将 JavaScripts 的输出路径从 scala.js 添加到 Play?

scala - Play什么时候加载application.conf?

html - 在 Java 中使用 Jsoup 将 HTML 表解析为 JSON