def METHOD_NAME(self):
    self.login_as(user=self.user)
    project = self.create_project(name="foo")
    release = Release.objects.create(organization_id=project.organization_id, version="1")
    release.add_project(project)
    from io import BytesIO
    f = File.objects.create(name="applications.js", type="release.file")
    f.putfile(BytesIO(b"File contents here"))
    releasefile = ReleaseFile.objects.create(
        organization_id=project.organization_id,
        project_id=project.id,
        release_id=release.id,
        file=f,
        name="  http://example.com/appli\n\rcatios n.js\n\n\r  ",
    )
    url = reverse(
        "sentry-api-0-organization-release-file-details",
        kwargs={
            "organization_slug": project.organization.slug,
            "version": release.version,
            "file_id": releasefile.id,
        },
    )
    response = self.client.get(url + "?download=1")
    assert response.status_code == 200, response.content
    assert response.get("Content-Disposition") == 'attachment; filename="appli catios n.js"'
    assert response.get("Content-Length") == str(f.size)
    assert response.get("Content-Type") == "application/octet-stream"
    assert b"File contents here" == close_streaming_response(response)
    user_no_permission = self.create_user("baz@localhost", username="baz")
    self.login_as(user=user_no_permission)
    response = self.client.get(url + "?download=1")
    assert response.status_code == 403, response.content