aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGravatar Aliaksandr Valialkin <valyala@gmail.com> 2015-12-10 13:17:21 +0200
committerGravatar Aliaksandr Valialkin <valyala@gmail.com> 2015-12-10 13:17:21 +0200
commit6db1946298c5ca2fd72ba97e344aad5b0ffc993f (patch)
treeae0f1ceecbf31f52060e512283a23fde04aca43e /examples
parentFixed misleading comments in workerpool (diff)
downloadfasthttp-6db1946298c5ca2fd72ba97e344aad5b0ffc993f.tar.gz
fasthttp-6db1946298c5ca2fd72ba97e344aad5b0ffc993f.tar.bz2
fasthttp-6db1946298c5ca2fd72ba97e344aad5b0ffc993f.zip
Use ctx.UserAgent() shortcut instead of ctx.Request.Header.UserAgent()
Diffstat (limited to 'examples')
-rw-r--r--examples/helloworldserver/helloworldserver.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/helloworldserver/helloworldserver.go b/examples/helloworldserver/helloworldserver.go
index cd10253..f4c9c3e 100644
--- a/examples/helloworldserver/helloworldserver.go
+++ b/examples/helloworldserver/helloworldserver.go
@@ -26,7 +26,7 @@ func requestHandler(ctx *fasthttp.RequestCtx) {
fmt.Fprintf(ctx, "Requested path is %q\n", ctx.Path())
fmt.Fprintf(ctx, "Host is %q\n", ctx.Host())
fmt.Fprintf(ctx, "Query string is %q\n", ctx.QueryArgs())
- fmt.Fprintf(ctx, "User-Agent is %q\n", ctx.Request.Header.UserAgent())
+ fmt.Fprintf(ctx, "User-Agent is %q\n", ctx.UserAgent())
fmt.Fprintf(ctx, "Connection has been established at %s\n", ctx.ConnTime())
fmt.Fprintf(ctx, "Request has been started at %s\n", ctx.Time())
fmt.Fprintf(ctx, "Serial request number for the current connection is %d\n", ctx.ConnRequestNum())