Skip to content

Unsafe change SDK state in downloadFile() #45

@dimitrystd

Description

@dimitrystd
    public function downloadFile($fileUri, $locale = '', DownloadFileParameters $params = null)
    {
        $this->isDownload = TRUE;
        ...
        $response = $this->sendRequest("locales/{$locale}/file", $params, self::HTTP_METHOD_GET, FALSE);
        $this->isDownload = FALSE;
        ...
    }

If exception happens in the middle of the method then $this->isDownload will still TRUE.

Proposed options

  • Use try finally
  • Use different methods for GET request with smartling response and GET requests for downloading files

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions