Skip to content

Commit

Permalink
Merge pull request DigitaleGesellschaft#47 from open-dynaMIX/do_not_p…
Browse files Browse the repository at this point in the history
…rocess_empty_lines

chore: move prevention of processing empty lines to run()
  • Loading branch information
open-dynaMIX authored Oct 19, 2020
2 parents c168037 + 1e63bea commit d090777
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
9 changes: 6 additions & 3 deletions anonip.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ def run(self, input_file=None):
while line:
line = line.rstrip()

if line.strip() == "":
logger.debug("Empty line detected. Doing nothing.")
yield line
line = input_file.readline()
continue

logger.debug("Got line: %r", line)

yield self.process_line(line)
Expand Down Expand Up @@ -180,9 +186,6 @@ def process_line(self, line):
:param line: str
:return: str
"""
if line.strip() == "":
logger.debug("Empty line detected. Doing nothing.")
return line
loglist = line.split(self.delimiter)

for index in self.columns:
Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3"

services:
nginx:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
- "8080:80"
27 changes: 27 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
events {
worker_connections 1024;
}


http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;
index index.html index.htm;

location /401 {
return 401;
}
}
}

0 comments on commit d090777

Please sign in to comment.