Parse a ``Connection`` header. Return a list of HTTP connection options. Args header: value of the ``Connection`` header. Raises: InvalidHeaderFormat: On invalid inputs.
(header: str)
| 245 | |
| 246 | |
| 247 | def parse_connection(header: str) -> list[ConnectionOption]: |
| 248 | """ |
| 249 | Parse a ``Connection`` header. |
| 250 | |
| 251 | Return a list of HTTP connection options. |
| 252 | |
| 253 | Args |
| 254 | header: value of the ``Connection`` header. |
| 255 | |
| 256 | Raises: |
| 257 | InvalidHeaderFormat: On invalid inputs. |
| 258 | |
| 259 | """ |
| 260 | return parse_list(parse_connection_option, header, 0, "Connection") |
| 261 | |
| 262 | |
| 263 | _protocol_re = re.compile( |
searching dependent graphs…