Skip to content

Commit d7cd392

Browse files
YuvalYuval
authored andcommitted
fix: conditionally enable HTTPS redirection and adjust Android scheme in capacitor config
1 parent dfae506 commit d7cd392

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/02-server/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,10 @@ await context.HttpContext.Response.WriteAsJsonAsync(new
507507
await next();
508508
});
509509

510-
app.UseHttpsRedirection();
510+
if (!app.Environment.IsDevelopment())
511+
{
512+
app.UseHttpsRedirection();
513+
}
511514
app.UseStaticFiles();
512515
app.UseCors("AllowClient");
513516
app.UseRateLimiter();

src/02-server/Services/FcmSender.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ private static void EnsureInitialized(IConfiguration config, ILogger logger)
4040
GoogleCredential? credential = null;
4141
if (!string.IsNullOrWhiteSpace(json))
4242
{
43-
credential = GoogleCredential.FromJson(json);
43+
credential = CredentialFactory.FromJson<ServiceAccountCredential>(json).ToGoogleCredential();
4444
}
4545
else if (!string.IsNullOrWhiteSpace(file) && File.Exists(file))
4646
{
47-
credential = GoogleCredential.FromFile(file);
47+
credential = CredentialFactory.FromFile<ServiceAccountCredential>(file).ToGoogleCredential();
4848
}
4949

5050
if (credential is null)

src/03-client/capacitor.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ const config: CapacitorConfig = {
77
appName: 'GroundShare',
88
webDir: 'dist',
99
android: {
10-
// Only allow http:// LAN backends in dev builds.
1110
allowMixedContent: isDev,
1211
},
1312
server: {
14-
androidScheme: 'https',
13+
androidScheme: isDev ? 'http' : 'https',
1514
iosScheme: 'capacitor',
1615
cleartext: isDev,
1716
},

0 commit comments

Comments
 (0)