Golang http: multiple response.WriteHeader calls

前端 未结 1 1916
一个人的身影
一个人的身影 2021-01-26 18:04

So I am currently writing a login and respectively a signup features for my Go web App and I am attempting to implement a feature that if you don\'t fill out both the required f

相关标签:
1条回答
  • 2021-01-26 18:31

    You can not send multiple responses to the same request (first the validation error (403 but 400 would be better) and then the redirection (301, ...)).

    You could use a meta tag or javascript to redirect on the client side after an delay or directly use the http redirect, like

    <meta http-equiv="refresh" content="3; URL=https://your.site/">
    
    0 讨论(0)
提交回复
热议问题