Skip to content

Commit

Permalink
Replacing magic number by well-known constant
Browse files Browse the repository at this point in the history
Improving code quality a bit by avoiding magic numbers.

Signed-off-by: Elv1zz <[email protected]>
  • Loading branch information
Elv1zz committed May 21, 2023
1 parent d797a45 commit 47653af
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import com.owncloud.android.lib.common.network.AdvancedX509KeyManager
import com.owncloud.android.lib.common.network.NetworkUtils
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.ui.dialog.SslUntrustedCertDialog
import org.apache.commons.httpclient.HttpStatus
import java.io.ByteArrayInputStream
import java.security.cert.CertificateException
import java.security.cert.CertificateFactory
Expand Down Expand Up @@ -106,7 +107,7 @@ open class NextcloudWebViewClient(val supportFragmentManager: FragmentManager) :
errorResponse: WebResourceResponse?
) {
val errorCode = errorResponse?.statusCode ?: return
if (errorCode == 400) {
if (errorCode == HttpStatus.SC_BAD_REQUEST) {
Log_OC.w(tag, "WebView failed with error code $errorCode; remove key chain aliases")
// chosen client certificate alias does not seem to work -> discard it
val failingUrl = request?.url ?: return
Expand Down

0 comments on commit 47653af

Please sign in to comment.