From 6892d31b1bd98aaf1e6cf9ca5e3d09683513e5f7 Mon Sep 17 00:00:00 2001 From: Daniel Grossmann-Kavanagh Date: Thu, 24 Jan 2019 16:34:49 -0800 Subject: [PATCH] Change normalize_path_middleware redirect from 301 -> 308 --- aiohttp/web_middlewares.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiohttp/web_middlewares.py b/aiohttp/web_middlewares.py index a6a444b42d4..59b6ff0a1ba 100644 --- a/aiohttp/web_middlewares.py +++ b/aiohttp/web_middlewares.py @@ -1,7 +1,7 @@ import re from typing import TYPE_CHECKING, Awaitable, Callable, Tuple, Type, TypeVar -from .web_exceptions import HTTPMove, HTTPMovedPermanently +from .web_exceptions import HTTPMove, HTTPPermanentRedirect from .web_request import Request from .web_response import StreamResponse from .web_urldispatcher import SystemRoute @@ -42,7 +42,7 @@ def middleware(f: _Func) -> _Func: def normalize_path_middleware( *, append_slash: bool=True, remove_slash: bool=False, merge_slashes: bool=True, - redirect_class: Type[HTTPMove]=HTTPMovedPermanently) -> _Middleware: + redirect_class: Type[HTTPMove]=HTTPPermanentRedirect) -> _Middleware: """ Middleware factory which produces a middleware that normalizes the path of a request. By normalizing it means: