Skip to content

Commit

Permalink
Use lowercase when specifying country code for moat API.
Browse files Browse the repository at this point in the history
This is only used when moat auto-detects the country and
returns no bridges.
  • Loading branch information
akwizgran committed Mar 12, 2024
1 parent 32055c8 commit 342646a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/java/org/onionshare/android/tor/TorManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.onionshare.android.DefaultClock
import org.onionshare.android.ui.settings.SettingsManager
import org.slf4j.LoggerFactory.getLogger
import java.io.IOException
import java.util.Locale.US
import java.util.concurrent.TimeUnit.MINUTES
import javax.inject.Inject
import javax.inject.Singleton
Expand Down Expand Up @@ -265,7 +266,7 @@ class TorManager(
)
val bridges = moat.get().let {
// if response was empty, try it again with what we think the country should be
if (it.isEmpty()) moat.getWithCountry(locationUtils.currentCountry)
if (it.isEmpty()) moat.getWithCountry(locationUtils.currentCountry.lowercase(US))
else it
}
return bridges.flatMap { bridge ->
Expand Down

0 comments on commit 342646a

Please sign in to comment.