finishing with Phase 2
This commit is contained in:
@@ -423,19 +423,6 @@ def api_packs_latest(request, namespace, pack_id):
|
||||
})
|
||||
|
||||
|
||||
def vanilla_asset(request, asset_path):
|
||||
"""Serve a bundled Minecraft vanilla resource (e.g. entity textures) — gated."""
|
||||
if not asset_path or asset_path.startswith('/') or '..' in asset_path.split('/'):
|
||||
raise Http404
|
||||
full = Path(settings.MEDIA_ROOT) / 'vanilla' / asset_path
|
||||
if not full.is_file():
|
||||
raise Http404
|
||||
content_type = mimetypes.guess_type(asset_path)[0] or 'application/octet-stream'
|
||||
response = HttpResponse(full.read_bytes(), content_type=content_type)
|
||||
response['Cache-Control'] = 'public, max-age=86400'
|
||||
return response
|
||||
|
||||
|
||||
def guide_doc(request, slug, version_id, file_uuid):
|
||||
"""Render one markdown guide document server-side (used by the switcher)."""
|
||||
version = get_object_or_404(
|
||||
|
||||
Reference in New Issue
Block a user