4 ms·
In this snippet ```python if header.startswith("X-Forwarded-"): section = header.removeprefix("X-Forwarded-") ``` the `startswith()` check is unnecessary. I
by ptmcg 2y ago
In this snippet
```python
if header.startswith("X-Forwarded-"):
section = header.removeprefix("X-Forwarded-")
```
the `startswith()` check is unnecessary. If `header` doesn't start with "X-Forwarded-" then `header.removeprefix("X-Forwarded-")` just returns `header`.
Nice summary doc, with good examples. You can also visit [this site of mine](https://ptmcg.pythonanywhere.com/python_nutshell_app_a_search https://ptmcg.pythonanywhere.com/python_nutshell_app_a_searc...) to search for changes by version (3.7-3.11).