소스 검색

Factoring out S3GoogleCloudHostName

Source commit: 4a2a8119a2709496787867927e549a37a5d3486c
Martin Prikryl 1 년 전
부모
커밋
5b47f251c7
3개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      source/core/S3FileSystem.cpp
  2. 2 1
      source/core/SessionData.cpp
  3. 1 0
      source/core/SessionData.h

+ 1 - 1
source/core/S3FileSystem.cpp

@@ -1166,7 +1166,7 @@ void TS3FileSystem::HandleNonBucketStatus(TLibS3CallbackData & Data, bool & Retr
 //---------------------------------------------------------------------------
 bool TS3FileSystem::IsGoogleCloud()
 {
-  return SameText(L"storage.googleapis.com", FTerminal->SessionData->HostNameExpanded);
+  return SameText(S3GoogleCloudHostName, FTerminal->SessionData->HostNameExpanded);
 }
 //---------------------------------------------------------------------------
 void TS3FileSystem::ReadDirectoryInternal(

+ 2 - 1
source/core/SessionData.cpp

@@ -78,6 +78,7 @@ const UnicodeString UrlRawSettingsParamNamePrefix(L"x-");
 const UnicodeString PassphraseOption(L"passphrase");
 const UnicodeString RawSettingsOption(L"rawsettings");
 const UnicodeString S3HostName(S3LibDefaultHostName());
+const UnicodeString S3GoogleCloudHostName(L"storage.googleapis.com");
 const UnicodeString OpensshHostDirective(L"Host");
 //---------------------------------------------------------------------
 TDateTime __fastcall SecToDateTime(int Sec)
@@ -2359,7 +2360,7 @@ bool __fastcall TSessionData::ParseUrl(UnicodeString Url, TOptions * Options,
         if ((AFSProtocol == fsWebDAV) &&
             (IsDomainOrSubdomain(HostName, S3HostName) ||
              IsDomainOrSubdomain(HostName, L"digitaloceanspaces.com") ||
-             IsDomainOrSubdomain(HostName, L"storage.googleapis.com") ||
+             IsDomainOrSubdomain(HostName, S3GoogleCloudHostName) ||
              IsDomainOrSubdomain(HostName, L"r2.cloudflarestorage.com")))
         {
           AFSProtocol = fsS3;

+ 1 - 0
source/core/SessionData.h

@@ -96,6 +96,7 @@ extern const UnicodeString UrlHostKeyParamName;
 extern const UnicodeString UrlSaveParamName;
 extern const UnicodeString PassphraseOption;
 extern const UnicodeString S3HostName;
+extern const UnicodeString S3GoogleCloudHostName;
 //---------------------------------------------------------------------------
 class TStoredSessionList;
 //---------------------------------------------------------------------------