aboutsummaryrefslogtreecommitdiff
path: root/server_test.go
diff options
context:
space:
mode:
authorGravatar Sergey Ponomarev <stokito@gmail.com> 2021-11-08 14:35:26 +0200
committerGravatar GitHub <noreply@github.com> 2021-11-08 13:35:26 +0100
commit3ff6aaa5917f40eeb5cdcb4272c58210f161f0ea (patch)
tree53ec8a4c5463d22aae967de353bc12e995da0152 /server_test.go
parenthttp.go: Request.SetURI() (Fix #1141) (#1148) (diff)
downloadfasthttp-3ff6aaa5917f40eeb5cdcb4272c58210f161f0ea.tar.gz
fasthttp-3ff6aaa5917f40eeb5cdcb4272c58210f161f0ea.tar.bz2
fasthttp-3ff6aaa5917f40eeb5cdcb4272c58210f161f0ea.zip
uri: isHttps() and isHttp() (#1150)
* uri: isHttps() and isHttp() Use them instead of manual schema comparison * uri: use SetSchemeBytes()
Diffstat (limited to 'server_test.go')
-rw-r--r--server_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/server_test.go b/server_test.go
index 1ffe396..4a29515 100644
--- a/server_test.go
+++ b/server_test.go
@@ -1158,9 +1158,8 @@ func TestServerServeTLSEmbed(t *testing.T) {
ctx.Error("expecting tls", StatusBadRequest)
return
}
- scheme := ctx.URI().Scheme()
- if string(scheme) != "https" {
- ctx.Error(fmt.Sprintf("unexpected scheme=%q. Expecting %q", scheme, "https"), StatusBadRequest)
+ if !ctx.URI().isHttps() {
+ ctx.Error(fmt.Sprintf("unexpected scheme=%q. Expecting %q", ctx.URI().Scheme(), "https"), StatusBadRequest)
return
}
ctx.WriteString("success") //nolint:errcheck