Is there a way to alter the request.path before matching the urls?

前端 未结 2 1511
眼角桃花
眼角桃花 2021-01-05 07:59

When I get a request for a path that includes the word \'self\' I want to replace it with the user id before matching it to a URL. I tried using a middleware like this:

2条回答
  •  -上瘾入骨i
    2021-01-05 08:13

    Apparently, the URL marching is not done using request.path but request.path_info. The same middleware altering this variable works.

提交回复
热议问题