Skip to content

Commit

Permalink
consertando coisinhas bobas
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosalles committed Sep 26, 2016
1 parent 1809958 commit 149f127
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.json.sample
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"port": 8181,
"read_length": 32,
"allow_serve_directories": true,
"allow_serve_directories": false,
"security" :
{
"realm": "realm",
Expand Down
5 changes: 2 additions & 3 deletions file.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from os import path as ospath
from mimetypes import MimeTypes


"""
Mapa constante de definição para tipos de arquivos
"""
Expand All @@ -27,7 +26,8 @@
},
'log': {
'read_type': 'r',
'mime_type': 'text/html; encoding=utf8'
'mime_type': 'text/html; encoding=utf8',
'isLog': True
},
'htm': {
'read_type': 'r',
Expand Down Expand Up @@ -116,6 +116,5 @@ def mount_directory_list(self):
add = ''
if ospath.isdir(path + '/' + item):
add = '/'
logger.debug(path)
content = content.replace(hidden_item, list_item % (path[5:] + item, item + add))
return content
6 changes: 1 addition & 5 deletions httphandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
level=logging.INFO)
logger = logging.getLogger(__name__)
formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
hdlr = logging.FileHandler('www/restrito/log.log')
hdlr = logging.FileHandler('www/restrito/server.log')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -68,10 +68,6 @@ def processarRequest(self):
# Depois de enviar a resposta ele fecha a thread em que ele está executando
thread.exit()

def send_401(self):
self.sendResponse(httpstatus.status[401], file_type['html']['mime_type'], httpstatus.status[401])
return

"""
Método que responde o cliente com uma msg em html, e um status
"""
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
config = {
'port': 8181,
'read_length': 32,
'allow_serve_directories': True,
'allow_serve_directories': False,
'security':
{
'realm': 'realm',
Expand Down
1 change: 1 addition & 0 deletions www/restrito/server.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 149f127

Please sign in to comment.