Changeset 10 in code
- Timestamp:
- Oct 25, 2016, 2:55:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/morty.go
r9 r10 124 124 125 125 func (p *Proxy) RequestHandler(ctx *fasthttp.RequestCtx) { 126 127 if appRequestHandler(ctx) { 128 return 129 } 130 126 131 requestHash := popRequestParam(ctx, []byte("mortyhash")) 127 132 … … 224 229 ctx.Write(responseBody) 225 230 } 231 } 232 233 func appRequestHandler(ctx *fasthttp.RequestCtx) bool { 234 if bytes.Equal(ctx.Path(), []byte("/robots.txt")) { 235 ctx.SetContentType("text/plain") 236 ctx.Write([]byte("User-Agent: *\nDisallow: /\n")) 237 return true 238 } 239 return false 226 240 } 227 241
Note:
See TracChangeset
for help on using the changeset viewer.