Return the version tag from the Accept header. If no version is specified, returns empty string.
(accept_header: List[str])
| 370 | |
| 371 | |
| 372 | def _get_version(accept_header: List[str]) -> str: |
| 373 | """Return the version tag from the Accept header. |
| 374 | |
| 375 | If no version is specified, returns empty string.""" |
| 376 | |
| 377 | for tok in accept_header: |
| 378 | if '=' not in tok: |
| 379 | continue |
| 380 | key, value = tok.strip().split('=', 1) |
| 381 | if key == 'version': |
| 382 | return value |
| 383 | return "" |
| 384 | |
| 385 | |
| 386 | def _get_escaping(accept_header: List[str]) -> str: |