| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/sdch_manager.h" | 5 #include "net/base/sdch_manager.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/sha2.h" | 10 #include "base/sha2.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 3 The parent domain of the referrer URL host name is not a top level | 339 3 The parent domain of the referrer URL host name is not a top level |
| 340 domain | 340 domain |
| 341 4 The dictionary URL is not an HTTPS URL. | 341 4 The dictionary URL is not an HTTPS URL. |
| 342 */ | 342 */ |
| 343 // Item (1) above implies item (2). Spec should be updated. | 343 // Item (1) above implies item (2). Spec should be updated. |
| 344 // I take "host name match" to be "is identical to" | 344 // I take "host name match" to be "is identical to" |
| 345 if (referring_url.host() != dictionary_url.host()) { | 345 if (referring_url.host() != dictionary_url.host()) { |
| 346 SdchErrorRecovery(DICTIONARY_LOAD_ATTEMPT_FROM_DIFFERENT_HOST); | 346 SdchErrorRecovery(DICTIONARY_LOAD_ATTEMPT_FROM_DIFFERENT_HOST); |
| 347 return false; | 347 return false; |
| 348 } | 348 } |
| 349 if (referring_url.SchemeIs("https")) { | 349 if (referring_url.SchemeIs("https") || referring_url.SchemeIs("httpsv")) { |
| 350 SdchErrorRecovery(DICTIONARY_SELECTED_FOR_SSL); | 350 SdchErrorRecovery(DICTIONARY_SELECTED_FOR_SSL); |
| 351 return false; | 351 return false; |
| 352 } | 352 } |
| 353 | 353 |
| 354 // TODO(jar): Remove this failsafe conservative hack which is more restrictive | 354 // TODO(jar): Remove this failsafe conservative hack which is more restrictive |
| 355 // than current SDCH spec when needed, and justified by security audit. | 355 // than current SDCH spec when needed, and justified by security audit. |
| 356 if (!referring_url.SchemeIs("http")) { | 356 if (!referring_url.SchemeIs("http")) { |
| 357 SdchErrorRecovery(DICTIONARY_SELECTED_FROM_NON_HTTP); | 357 SdchErrorRecovery(DICTIONARY_SELECTED_FROM_NON_HTTP); |
| 358 return false; | 358 return false; |
| 359 } | 359 } |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 case '/': | 541 case '/': |
| 542 (*output)[i] = '_'; | 542 (*output)[i] = '_'; |
| 543 continue; | 543 continue; |
| 544 default: | 544 default: |
| 545 continue; | 545 continue; |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 } | 548 } |
| 549 | 549 |
| 550 } // namespace net | 550 } // namespace net |
| OLD | NEW |