Endpoint
Authentication
Requires Bearer token authentication via theAuthorization header.
Path Parameters
The UUID of the server
Query Parameters
The file path to read (relative to server root)
If present (any value), the response will include download headers
Response
Returns the raw file contents with appropriate headers.Response Headers
X-Mime-Type: Detected MIME type of the fileContent-Length: Size of the file in bytesContent-Disposition: Set toattachmentifdownloadparameter is presentContent-Type: Set toapplication/octet-streamfor downloads, otherwise the file’s MIME type
Example Request
Behavior
- Leading slashes in the file path are automatically stripped
- Named pipes cannot be opened (returns 400 error)
- File size is determined at request time and a limited reader prevents content overflow
- Path traversal is prevented - files outside the server directory cannot be accessed
Error Responses
400 Bad Request
400 Bad Request
File is a named pipe or another unsupported file type
401 Unauthorized
401 Unauthorized
404 Not Found
404 Not Found
Server or file does not exist
500 Internal Server Error
500 Internal Server Error
Failed to read file contents
Use Cases
- View configuration files
- Read log files
- Download world/map files
- Inspect server data files
Source Reference
Implementation:router/router_server_files.go:30-75