(t *testing.T)
| 5171 | } |
| 5172 | |
| 5173 | func Test_Ctx_Range_Overflow(t *testing.T) { |
| 5174 | t.Parallel() |
| 5175 | app := New() |
| 5176 | c := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 5177 | defer app.ReleaseCtx(c) |
| 5178 | |
| 5179 | tooBig := uint64((math.MaxUint64 >> 1) + 1) |
| 5180 | |
| 5181 | c.Request().Header.Set(HeaderRange, fmt.Sprintf("bytes=%d-100", tooBig)) |
| 5182 | _, err := c.Range(math.MaxInt64) |
| 5183 | require.ErrorIs(t, err, ErrRangeMalformed) |
| 5184 | |
| 5185 | c.Request().Header.Set(HeaderRange, fmt.Sprintf("bytes=0-%d", tooBig)) |
| 5186 | _, err = c.Range(math.MaxInt64) |
| 5187 | require.ErrorIs(t, err, ErrRangeMalformed) |
| 5188 | } |
| 5189 | |
| 5190 | func Test_Ctx_Range_Unsatisfiable(t *testing.T) { |
| 5191 | t.Parallel() |
nothing calls this directly
no test coverage detected