gofiber / fiber

⚡️ Express inspired web framework written in Go

Home Page:https://gofiber.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

📝 *** CLOSE - I see Context( ) returns this type .... *** - r4[Proposal]: Add RequestCtx in ctx that returns *fasthttp from DefaultCtx

rabarar opened this issue · comments

Feature Proposal Description

Give the users access to the whole fasthttp request for more control (i.e. accessing client certs via ctx) by creating a method similar to func (c *DefaultCtx) Request() *fasthttp.Request in ctx.go but instead returns *fasthttp

Alignment with Express API

unknown. don't use javascript

HTTP RFC Standards Compliance

confirmed

API Stability

this feature doesn't affect API Stability

Feature Examples

// RequestCtx return the *fasthttp object
// This allows you to use all fasthttp.RequestCtx methods
// https://godoc.org/github.com/valyala/fasthttp#RequestCtx
func (c *DefaultCtx) Request() *fasthttp.RequestCtx {
    return &c.fasthttp
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have searched for existing issues that describe my proposal before opening this one.
  • I understand that a proposal that does not meet these guidelines may be closed without explanation.

Thanks for opening your first issue here! 🎉 Be sure to follow the issue template! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

commented

@rabarar
Have you checked the context method?

fiber/ctx.go

Line 305 in 7ba02c1

func (c *DefaultCtx) Context() *fasthttp.RequestCtx {

commented

Can we close the feature request? Because its there?