open the requested file in HTTP requests Args: filename: path and the filename Returns: content of the file or abort(404)
(filename)
| 66 | |
| 67 | |
| 68 | def get_file(filename): |
| 69 | """ |
| 70 | open the requested file in HTTP requests |
| 71 | |
| 72 | Args: |
| 73 | filename: path and the filename |
| 74 | |
| 75 | Returns: |
| 76 | content of the file or abort(404) |
| 77 | """ |
| 78 | try: |
| 79 | src = os.path.join(root_dir(), filename) |
| 80 | return open(src, 'rb').read() |
| 81 | except IOError: |
| 82 | abort(404) |
| 83 | |
| 84 | |
| 85 | def get_value_from_request(_key): |
no test coverage detected