Get OpenAI API token status (without revealing the actual token)
()
| 19239 | try: |
| 19240 | actual_path = _resolve_legacy_path('/backups', shared_data.backupdir, file_path) |
| 19241 | except ValueError: |
| 19242 | return jsonify({'error': 'Invalid path'}), 400 |
| 19243 | elif file_path == '/uploads' or file_path.startswith('/uploads/'): |
| 19244 | try: |
| 19245 | actual_path = _resolve_legacy_path('/uploads', shared_data.upload_dir, file_path) |
| 19246 | except ValueError: |
| 19247 | return jsonify({'error': 'Invalid path'}), 400 |
| 19248 | else: |
| 19249 | return jsonify({'error': 'Invalid path'}), 400 |
| 19250 | |
| 19251 | if not os.path.isfile(actual_path): |
| 19252 | return jsonify({'error': 'File not found'}), 404 |
| 19253 | |
| 19254 | actual_path = os.path.realpath(actual_path) |
| 19255 | |
| 19256 | mime_type, _ = mimetypes.guess_type(actual_path) |
| 19257 | mime_type = mime_type or 'application/octet-stream' |
| 19258 | file_size = os.path.getsize(actual_path) |
| 19259 | ext = os.path.splitext(actual_path)[1].lower() |
nothing calls this directly
no test coverage detected