Fix _examples/mvc/login/user/controller.go redirection from POST: /user/register to GET: /user/me as reported at https://github.com/kataras/iris/issues/777

Former-commit-id: f26d36dfcb21fae7d3ce9b92fa97611dbc15802d
This commit is contained in:
Gerasimos (Makis) Maropoulos 2017-10-05 03:26:39 +03:00
parent f780159afe
commit b2a24d36e8
3 changed files with 14 additions and 6 deletions

View File

@ -81,6 +81,8 @@ Help this project to continue deliver awesome and unique features with the highe
| [Bill Q.](https://github.com/hiveminded) | 600 EUR | **Gold** |
| [Conrad Steenberg](https://github.com/hengestone) | 25 EUR | Bronze |
_Psst_, we've produced a small video about your feelings regrating to Iris! You can watch the video at https://www.youtube.com/watch?v=jGx0LkuUs4A.
### 📑 Table of contents
* [Installation](#-installation)
@ -113,8 +115,8 @@ Help this project to continue deliver awesome and unique features with the highe
* [Dockerize](https://github.com/iris-contrib/cloud-native-go)
* [Community & Support](#-community)
* [Blogs](https://iris-go.com/v8/blogs)
- [How to build a file upload form using DropzoneJS and Go](https://dev.to/kataras/dropzonejs--go-series---part-1-474)
- [How to display existing files on server using DropzoneJS and Go](https://dev.to/kataras/dropzonejs--go-series---part-2-4n1)
- [How to build a file upload form using DropzoneJS and Go](https://hackernoon.com/how-to-build-a-file-upload-form-using-dropzonejs-and-go-8fb9f258a991)
- [How to display existing files on server using DropzoneJS and Go](https://hackernoon.com/how-to-display-existing-files-on-server-using-dropzonejs-and-go-53e24b57ba19)
- [Iris Go vs .NET Core Kestrel in terms of HTTP performance](https://hackernoon.com/iris-go-vs-net-core-kestrel-in-terms-of-http-performance-806195dc93d5)
- [Go vs .NET Core in terms of HTTP performance](https://medium.com/@kataras/go-vs-net-core-in-terms-of-http-performance-7535a61b67b8)
- [Iris, a modular web framework](https://medium.com/@corebreaker/iris-web-cd684b4685c7)

View File

@ -330,10 +330,8 @@ typescript automation tools have their own repository: [https://github.com/katar
> I'd like to tell you that you can use your favourite but I don't think you will find such a thing anywhere else.
### Hey, You!
### Hey, You
Developers should read the [godocs](https://godoc.org/github.com/kataras/iris) for a better understanding.
Developers should read the [godocs](https://godoc.org/github.com/kataras/iris) and https://docs.iris-go.com for a better understanding.
Psst, I almost forgot; do not forget to [star or watch](https://github.com/kataras/iris/stargazers) the project in order to stay updated with the latest tech trends, it never takes more than a second!

View File

@ -46,6 +46,14 @@ func (c *Controller) PostRegister() {
// setting a session value was never easier.
c.Session.Set(sessionIDKey, user.ID)
// succeed, nothing more to do here, just redirect to the /user/me.
// When redirecting from POST to GET request you -should- use this HTTP status code,
// however there're some (complicated) alternatives if you
// search online or even the HTTP RFC.
c.Status = 303 // "See Other" RFC 7231
// Redirect to GET: /user/me
// by changing the Path (and the status code because we're in POST request at this case).
c.Path = pathMyProfile
}