Граф коммитов

4 Коммитов

Автор SHA1 Сообщение Дата
Julie Qiu 5c911301f2 internal/middleware: fix isRobot
Previously, isRobot was always returning true due to a bug in the
function and tests. This logic is now fixed.

Change-Id: Iac406355b9d3ca2a60701940e72ee197d6c32c25
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/276195
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-12-08 21:33:36 +00:00
Julie Qiu 4455cb8afd internal/middleware: log isRobot in requestlog
It's useful to have data on which requests are bots vs actual browser
requests, to help make decisions around which requests are worth caching.

An isRobot value is now logged with each request.

Change-Id: I49776deb7850e352845358643db00624a4854801
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/265137
Trust: Julie Qiu <julie@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
2020-10-27 16:55:34 +00:00
Rob Findley 8e0c566ca8 internal/middleware: close http bodies in test code
Findings from https://github.com/timakin/bodyclose are fixed.

Change-Id: I7bf0a7f5e3a0a77059e7f02a0644e4db073d6734
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/509858
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-03-27 16:46:40 -04:00
Rob Findley 555b8e3131 internal/middleware: add a request logging middleware
A new middleware is added that logs requests to the stackdriver API.

Fixes b/137375523

Change-Id: I6d09999b9af627c4ecfc54b514c0d7e4fd000364
Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/506029
Reviewed-by: Julie Qiu <julieqiu@google.com>
2020-03-27 16:46:40 -04:00