Skip to content

修复在调用SetMethodNotAllowedHandle时修改StatusCode无效问题#221

Merged
devfeel merged 1 commit intomasterfrom
develop
Nov 9, 2019
Merged

修复在调用SetMethodNotAllowedHandle时修改StatusCode无效问题#221
devfeel merged 1 commit intomasterfrom
develop

Conversation

@devfeel
Copy link
Owner

@devfeel devfeel commented Nov 9, 2019

Version 1.7.6

  • Fix: 修复在调用SetMethodNotAllowedHandle时修改StatusCode无效问题
  • Opt: 将路由阶段设置405代码逻辑移除,相关逻辑在DefaultMethodNotAllowedHandler实现
  • About MethodNotAllowedHandle:
    • 默认使用DefaultMethodNotAllowedHandler
    • 如调用SetMethodNotAllowedHandle,则使用用户代码覆盖DefaultMethodNotAllowedHandler
  • How to use SetMethodNotAllowedHandle:
app.SetMethodNotAllowedHandle(func(ctx dotweb.Context){
    ctx.Redirect(301, "/")
})
  • 2019-11-10 00:00 at ShangHai

* Fix: 修复在调用SetMethodNotAllowedHandle时修改StatusCode无效问题
* Opt: 将路由阶段设置405代码逻辑移除,相关逻辑在DefaultMethodNotAllowedHandler实现
* About MethodNotAllowedHandle:
    - 默认使用DefaultMethodNotAllowedHandler
    - 如调用SetMethodNotAllowedHandle,则使用用户代码覆盖DefaultMethodNotAllowedHandler
* How to use SetMethodNotAllowedHandle:
~~~ go
app.SetMethodNotAllowedHandle(func(ctx dotweb.Context){
    ctx.Redirect(301, "/")
})
~~~
* 2019-11-10 00:00 at ShangHai
@devfeel devfeel merged commit ce067d8 into master Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant