Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsafe change SDK state in downloadFile() #45

Open
dimitrystd opened this issue Jan 26, 2016 · 0 comments
Open

Unsafe change SDK state in downloadFile() #45

dimitrystd opened this issue Jan 26, 2016 · 0 comments
Assignees

Comments

@dimitrystd
Copy link
Contributor

    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants