rfc

异常:Invalid character found in the request target. The valid characters are defined in RFC 3986

无人久伴 提交于 2019-12-01 07:20:50
一、背景   事情是这样的,前几天做一个基本的数据库“增删改查”的需求,前端传参的方式是“JSON字符串”,后端接收到此参数后,使用阿里巴巴fastjson进行解析,然后入库。需求很简单吧,但是偏偏遇到问题了。   我发现,JSON字符串里面无数组,纯粹的都是json结构的时候,即都是“{}”时,不会报错,传参入库没问题。但是只要传参的值里面有数组,即有“[]”的结构时,就报错。报错内容如下(我的tomcat版本是 8.5.45 ): 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.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:479) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:684) at org.apache.coyote.AbstractProcessorLight.process

multipart/form-data, what is the default charset for fields?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 03:09:46
what is the default encoding one should use to decode multipart/form-data if no charset is given? RFC2388 states: 4.5 Charset of text in form data Each part of a multipart/form-data is supposed to have a content- type. In the case where a field element is text, the charset parameter for the text indicates the character encoding used. For example, a form with a text field in which a user typed 'Joe owes <eu>100' where <eu> is the Euro symbol might have form data returned as: --AaB03x content-disposition: form-data; name="field1" content-type: text/plain;charset=windows-1250 content-transfer

In HTTP specification, what is the string that separates cookies?

♀尐吖头ヾ 提交于 2019-11-30 14:38:32
问题 Semicolon ; , the Cookie: string or some other string? 回答1: Inspecting cookies in an HTTP request The Cookie: header has the following syntax: Cookie: <Name> = <Value> { ; <Name> = <Value> } Hence individual cookies are separated with the semicolon. Setting cookies in an HTTP response On the other hand, when setting a cookie in the response, there one cookie per the Set-Cookie: header: Set-Cookie: <Name> = <Value> [ ; expires = <Date>] [ ; path = <Path> ] [ ; domain = <Domain> ] // etc… To

In HTTP specification, what is the string that separates cookies?

一曲冷凌霜 提交于 2019-11-30 11:11:13
Semicolon ; , the Cookie: string or some other string? Inspecting cookies in an HTTP request The Cookie: header has the following syntax: Cookie: <Name> = <Value> { ; <Name> = <Value> } Hence individual cookies are separated with the semicolon. Setting cookies in an HTTP response On the other hand, when setting a cookie in the response, there one cookie per the Set-Cookie: header: Set-Cookie: <Name> = <Value> [ ; expires = <Date>] [ ; path = <Path> ] [ ; domain = <Domain> ] // etc… To set multiple cookies the Set-Cookie header is repeated in an HTTP response. Notes: Have a look here for a

HTTP状态码详解

爱⌒轻易说出口 提交于 2019-11-30 07:15:42
转自 konglingbin HTTP状态码详解 : https://www.cnblogs.com/klb561/p/9205867.html HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应状态的3位数字代码。它由 RFC 2616 规范定义的 ,并得到RFC 2518、RFC 2817、RFC 2295、RFC 2774、RFC 4918等规范扩展。所有状态码的第一个数字代表了响应 的五种状态之一。 我们经常使用浏览器发出http请求,那么对于请求返回的状态,对于开发人员来讲,我们必须要明白其所代表的含义,如: 常见状态吗:400(请求无效),401(需要权限),500(服务器错误), 2、具体含义 1xx 消息 这一类型的状态码,代表请求已被接受,需要继续处理。这类响应是临时响应,只包含状态行和某些可选的响应头信息,并 以空行结束。由于 HTTP/1.0 协议中没有定义任何 1xx 状态码,所以除非在某些试验条件下,服务器禁止向此类客户端发 送 1xx 响应。 100   客户端应当继续发送请求。这个临时响应是用来通知客户端它的部分请求已经被服务器接收,且仍未被拒绝。客户端应 当继续发送请求的剩余部分,或者如果请求已经完成,忽略这个响应。服务器必须在请求完成后向客户端发送一个最终响应 。 101   服务器已经理解了客户端的请求

When should an asterisk be encoded in an HTTP URL?

偶尔善良 提交于 2019-11-30 06:52:45
问题 According to RFC1738, an asterisk (*) "may be used unencoded within a URL": Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL. However, w3.org's Naming and Addressing material says that the asterisk is "reserved for use as having special signifiance within specific schemes" and implies that it should be encoded. Also, according to RFC3986, a URL is a URI: The term "Uniform Resource

How to fragment H264 Packets in RTP compliant with RFC3984

不打扰是莪最后的温柔 提交于 2019-11-30 05:10:20
I have the FFMPEG streaming baseline h264 video, which I have to encapsulate in RTP and send to SIP phones for their decoding. I am using Linphone with the h264 plugin for Windows and Mirial for the decoding progress. However, sometimes I get a huge frame size (3Kb ~ 9Kb) from the FFMPEG, which obviously doesn't fit in the MTU. If I send these frames "as is" and trusting IP fragmentation feature, some phones are able to play it well enough, but others choke and can't decode the stream. I think this is because the stream is not compliant with the RFC 3984 that specifies that packets that don't

What is the maximum length of a DNS name

让人想犯罪 __ 提交于 2019-11-30 03:02:58
I saw several mentions that the maximum string length of a DNS name (domain name) is 253 characters. Wikipedia seems to be referring this old blog post: https://en.wikipedia.org/wiki/Hostname http://blogs.msdn.com/b/oldnewthing/archive/2012/04/12/10292868.aspx On the other hand, if I understood the RFC, this article is wrong. DNS name maximum string length should be 250 ASCII characters instead of 253 based on the following byte sequence which as per RFC1035 is maxed to 255 bytes: To simplify implementations, the total length of a domain name (i.e., label octets and label length octets) is

What characters can one use in a URL?

我的未来我决定 提交于 2019-11-30 02:11:47
问题 I have an application that takes all the parameters in the url like this: /category/subcategory/sub-subcategory . I want to be able to give out extra parameters at the end of the URL, like page-2/order-desc . This would make the whole URL into cat/subcat/sub-subcat{delimiting-character}page-2/order-desc . My question is: what characters could I use as {delimiting-character} . I tend to prefer ":" as I know for sure it will never appear anyplace else but I don't know if it would be standard

What's the deal with HTTP status code 308?

岁酱吖の 提交于 2019-11-29 16:44:57
问题 An IETF RFC draft The Hypertext Transfer Protocol (HTTP) Status Code 308 (Permanent Redirect) defines HTTP status 308 as Permanent Redirect . It should, of course, be noted that this is a draft document and contains in its document header the text "Expires: September 27, 2012", which I presume would mean it should be considered invalid now, but I'm not familiar with IETF's processes and so don't feel confident about this. The Wikipedia article List of HTTP status codes uses this definition of