Don't try to parse JSON being returned from the API

This commit is contained in:
Dane Everitt 2019-09-29 15:32:22 -07:00
parent 6f65f6a217
commit ac52810ef6
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 8 additions and 2 deletions

View file

@ -85,7 +85,9 @@ class FileController extends ClientApiController
return Response::create( return Response::create(
$this->fileRepository->setServer($server)->getContent( $this->fileRepository->setServer($server)->getContent(
$request->get('file'), config('pterodactyl.files.max_edit_size') $request->get('file'), config('pterodactyl.files.max_edit_size')
) ),
Response::HTTP_OK,
['Content-Type' => 'text/plain']
); );
} }

View file

@ -2,7 +2,11 @@ import http from '@/api/http';
export default (server: string, file: string): Promise<string> => { export default (server: string, file: string): Promise<string> => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
http.get(`/api/client/servers/${server}/files/contents`, { params: { file } }) http.get(`/api/client/servers/${server}/files/contents`, {
params: { file },
transformResponse: res => res,
responseType: 'text/plain',
})
.then(({ data }) => resolve(data)) .then(({ data }) => resolve(data))
.catch(reject); .catch(reject);
}); });