isBatch returns true when the first non-whitespace characters is '['
(msg json.RawMessage)
| 123 | |
| 124 | // isBatch returns true when the first non-whitespace characters is '[' |
| 125 | func isBatch(msg json.RawMessage) bool { |
| 126 | for _, c := range msg { |
| 127 | // skip insignificant whitespace (http://www.ietf.org/rfc/rfc4627.txt) |
| 128 | if c == 0x20 || c == 0x09 || c == 0x0a || c == 0x0d { |
| 129 | continue |
| 130 | } |
| 131 | return c == '[' |
| 132 | } |
| 133 | return false |
| 134 | } |
| 135 | |
| 136 | // ReadRequestHeaders will read new requests without parsing the arguments. It will |
| 137 | // return a collection of requests, an indication if these requests are in batch |
no outgoing calls
no test coverage detected