Skip to content

Commit

Permalink
docs: Fix typo in tutorial.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
cgmark101 authored and defnull committed Oct 28, 2024
1 parent 7a7e544 commit 7af7135
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ Note that we used the ``:path`` route filter here to allow slash characters in `

The :func:`static_file` helper function has a lot of benefits compared to handling files manually. Most importantly it prevents `directory traversal attacks <https://owasp.org/www-community/attacks/Path_Traversal>`_ (e.g. ``GET /static/../../../../etc/secrets``) by restricting file access to the specified ``root`` directory. Make sure to use an absolut path for ``root``, though. Relative paths (staring with ``./``) are resolved against the current work directory which may not always be the same as your project directory.

The :func:`static_file` function returns :class:`HTTPResponse` or :class:`HTTPError`, which can be raied as an exception if you need to.
The :func:`static_file` function returns :class:`HTTPResponse` or :class:`HTTPError`, which can be raised as an exception if you need to.

.. rubric:: File downloads

Expand Down

0 comments on commit 7af7135

Please sign in to comment.