日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC

發(fā)布時(shí)間:2024/9/27 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

轉(zhuǎn)載:(http://blog.csdn.net/zeroso/article/details/70592179)

錯(cuò)誤現(xiàn)象:

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:189)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1000)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)



最近部署項(xiàng)目的時(shí)候,由于MIS配置的是Tomcat 8.5的服務(wù)端,導(dǎo)致Web應(yīng)用不正常,報(bào)HTTP 400錯(cuò)誤(Chrome無異常、IE報(bào)錯(cuò))。問題原因初步判斷為8.5版本的服務(wù)端接收請(qǐng)求不會(huì)對(duì)符號(hào)進(jìn)行轉(zhuǎn)義,Chrome不異常的原因或許是瀏覽器自身轉(zhuǎn)義了。具體錯(cuò)誤信息如下:


Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:472)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:683)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:745)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986

查閱了大量資料后,有兩種解決方案:

Plan 1:?
更換低版本的Tomcat來規(guī)避這種問題。

Plan 2:?
在conf/catalina.properties中最后添加一行:

org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

重啟服務(wù)器后,解決問題。

官方指南地址:http://tomcat.apache.org/tomcat-8.5-doc/config/systemprops.html

官方說明:

org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH

If this is true ‘%2F’ and ‘%5C’ will be permitted as path.delimiters.If not specified, the default value of false will be used.

總結(jié)

以上是生活随笔為你收集整理的Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。