From e53de6985a6ffe5cfb6d3749239d77925202b58d 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 DO NOT MERGE * Fixes #2173664 * Make sure that not only is the OPTIONS command accepted, but that the server reports EAS versions and commands Change-Id: Ic29d3eacfdc54d107600afc443964a1e8b3d5e59 --- 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 77f326016..0f2a34594 100644 --- a/src/com/android/exchange/EasSyncService.java +++ b/src/com/android/exchange/EasSyncService.java @@ -208,6 +208,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; }