HandleContext re-enters a context that has been rewritten. This can be done by setting c.Request.URL.Path to your new target. Disclaimer: You can loop yourself to deal with this, use wisely.
(c *Context)
| 678 | // This can be done by setting c.Request.URL.Path to your new target. |
| 679 | // Disclaimer: You can loop yourself to deal with this, use wisely. |
| 680 | func (engine *Engine) HandleContext(c *Context) { |
| 681 | oldIndexValue := c.index |
| 682 | oldHandlers := c.handlers |
| 683 | c.reset() |
| 684 | engine.handleHTTPRequest(c) |
| 685 | |
| 686 | c.index = oldIndexValue |
| 687 | c.handlers = oldHandlers |
| 688 | } |
| 689 | |
| 690 | func (engine *Engine) handleHTTPRequest(c *Context) { |
| 691 | httpMethod := c.Request.Method |