diff options
author | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-14 17:34:12 +0200 |
---|---|---|
committer | Aliaksandr Valialkin <valyala@gmail.com> | 2015-11-14 17:34:12 +0200 |
commit | 1f81c87c3817b03e3bf632c0eab90e27fcc26266 (patch) | |
tree | 34c7305a73a0459b3446cde7c96fe006d720b490 /server_timing_test.go | |
parent | Added Concurrency parameter to Server (diff) | |
download | fasthttp-1f81c87c3817b03e3bf632c0eab90e27fcc26266.tar.gz fasthttp-1f81c87c3817b03e3bf632c0eab90e27fcc26266.tar.bz2 fasthttp-1f81c87c3817b03e3bf632c0eab90e27fcc26266.zip |
Substituted direct access to Request.Method by accessors, so package users don't shoot in the foot when assigning directly to Request.Method
Diffstat (limited to 'server_timing_test.go')
-rw-r--r-- | server_timing_test.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server_timing_test.go b/server_timing_test.go index 82e3521..bb1236e 100644 --- a/server_timing_test.go +++ b/server_timing_test.go @@ -277,8 +277,8 @@ func benchmarkServerGet(b *testing.B, clientsCount, requestsPerConn int) { ch := make(chan struct{}, b.N) s := &Server{ Handler: func(ctx *RequestCtx) { - if !ctx.Request.Header.IsMethodGet() { - b.Fatalf("Unexpected request method: %s", ctx.Request.Header.Method) + if !ctx.IsGet() { + b.Fatalf("Unexpected request method: %s", ctx.Method()) } ctx.Success("text/plain", fakeResponse) if requestsPerConn == 1 { @@ -316,8 +316,8 @@ func benchmarkServerPost(b *testing.B, clientsCount, requestsPerConn int) { ch := make(chan struct{}, b.N) s := &Server{ Handler: func(ctx *RequestCtx) { - if !ctx.Request.Header.IsMethodPost() { - b.Fatalf("Unexpected request method: %s", ctx.Request.Header.Method) + if !ctx.IsPost() { + b.Fatalf("Unexpected request method: %s", ctx.Method()) } body := ctx.Request.Body if !bytes.Equal(body, fakeResponse) { |