From 8063528202b66433388a859175ed29d5b6ebd59d Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Wed, 7 Oct 2009 17:10:46 -0700 Subject: [PATCH] Server validates even though server address is wrong * Fixes #2173664 * Make sure that not only is the OPTIONS command accepted, but that the server reports EAS versions and commands Change-Id: I15dccd1fbd06aa3cf2ba8fbbf72d20918ec44617 --- src/com/android/exchange/EasSyncService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/exchange/EasSyncService.java b/src/com/android/exchange/EasSyncService.java index b2532a1c5..116198010 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -209,6 +209,12 @@ public class EasSyncService extends AbstractSyncService { userLog("Validation (OPTIONS) response: " + code); if (code == HttpStatus.SC_OK) { // No exception means successful validation + Header commands = resp.getFirstHeader("MS-ASProtocolCommands"); + Header versions = resp.getFirstHeader("ms-asprotocolversions"); + if (commands == null || versions == null) { + userLog("OPTIONS response without commands or versions; reporting I/O error"); + throw new MessagingException(MessagingException.IOERROR); + } userLog("Validation successful"); return; }