Skip to content

Commit

Permalink
Update parse middleware docs
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Oct 22, 2024
1 parent 725aefa commit d0b9367
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/basics/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ router.GlobalMiddleware(&parse.Middleware{
})
```

This middleware is reading the raw request query and body.
This middleware is reading and parsing the raw request query and body.

First, the query is parsed using Go's standard `url.ParseQuery()`. After being flattened (single value arrays converted to non-array), the result is put in the request's `Query`. If the parsing fails, it returns `400 Bad request`.

Expand All @@ -76,6 +76,8 @@ an error, returns `400 Bad request`.

In `multipart/form-data`, all file parts are automatically converted to `[]fsutil.File`. Inside `request.Data`, a field of type "file" will therefore always be of type `[]fsutil.File`. It is a slice so it support multi-file uploads in a single field.

The middleware is skipped if the matched route is the "not found" or "method not allowed" route.

### Compress

```go
Expand Down

0 comments on commit d0b9367

Please sign in to comment.