Skip to content

Commit

Permalink
Ensure non-pip /simple/ requests are not logged
Browse files Browse the repository at this point in the history
  • Loading branch information
bennuttall committed Sep 17, 2020
1 parent 7e7a597 commit f629583
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions piwheels/logger/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
(None, '/project/', None),
('pip/*', '/simple/*.whl', 'LOGDOWNLOAD'),
('pip/*', '/simple/*', 'LOGSEARCH'),
(None, '/simple/*', None),
(None, '/project/*/json/', 'LOGJSON'),
(None, '/project/*/json/index.json', 'LOGJSON'),
(None, '/project/*', 'LOGPROJECT'),
Expand Down
4 changes: 3 additions & 1 deletion tests/logger/test_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ def log_sample():
2a00:1098:0:82:1000:3b:1:1 - - [11/Oct/2019:07:11:29 +0100] "GET / HTTP/1.1" 200 6297 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
2a00:1098:0:82:1000:3b:1:1 - - [11/Oct/2019:06:26:56 +0100] "GET /project/ici/ HTTP/1.1" 200 6499 "-" "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
2a00:1098:0:82:1000:3b:1:1 - - [11/Oct/2019:06:26:56 +0100] "GET /project/pyjokes/ HTTP/1.1" 200 6499 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
2a00:1098:0:82:1000:3b:1:1 - - [11/Oct/2019:06:26:56 +0100] "GET /simple/index.html HTTP/1.1" 200 6499 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
2a00:1098:0:82:1000:3b:1:1 - - [11/Oct/2019:06:26:56 +0100] "GET /project/Flask/ HTTP/1.1" 200 6499 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1"
"""
entries =[
entries = [
('LOGSEARCH', [
'markupsafe',
'2a00:1098:0:80:1000:3b:1:1',
Expand Down Expand Up @@ -196,6 +197,7 @@ def log_sample():
datetime(2019, 10, 11, 5, 26, 56, tzinfo=UTC),
'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1',
]),
# The log entry here does not match a log type and thus produces no entries
('LOGPROJECT', [
'flask',
'2a00:1098:0:82:1000:3b:1:1',
Expand Down

0 comments on commit f629583

Please sign in to comment.