Skip to content

Comments

feat: add ability to skip validation checks#66

Open
jamietanna wants to merge 1 commit intomainfrom
feat/skipper
Open

feat: add ability to skip validation checks#66
jamietanna wants to merge 1 commit intomainfrom
feat/skipper

Conversation

@jamietanna
Copy link
Member

@jamietanna jamietanna commented Feb 8, 2026

As noted in #63, an equivalent to Echo's Skipper would allow for
middleware users to opt-out of validation in a more straightforward way.

In a slightly different implementation to our echo-middleware, this
does not allow the Skipper to consume the body of the original
request, and instead duplicates it for the Skipper, and the other uses
of it.

@jamietanna jamietanna linked an issue Feb 8, 2026 that may be closed by this pull request
As noted in #63, an equivalent to Echo's `Skipper` would allow for
middleware users to opt-out of validation in a more straightforward way.

In a slightly different implementation to our `echo-middleware`, this
does not allow the `Skipper` to consume the body of the original
request, and instead duplicates it for the `Skipper`, and the other uses
of it.

Closes #63.
@jamietanna jamietanna marked this pull request as ready for review February 8, 2026 19:09
@jamietanna jamietanna requested a review from a team as a code owner February 8, 2026 19:09
@jamietanna
Copy link
Member Author

@GreyXor how does this look?

@GreyXor
Copy link

GreyXor commented Feb 10, 2026

@GreyXor how does this look?

LGTM! :)

r2 := r.Clone(r.Context())

if r.Body != nil {
bodyBytes, err := io.ReadAll(r.Body)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to think about this, because by reading the body, you are assuming that people aren't streaming a gigantic request. This choice has some memory usage and deserialization consequences.

I don't think we should copy the request, and pass the original request into the skipper. The user can decide whether or not to read the body; they may be able to decide if skipping is needed based on headers alone.

What do you think?

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.

Equivalent of Echo skipper ?

3 participants