Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
| 5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
| 7 * | 7 * |
| 8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
| 9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
| 10 * are met: | 10 * are met: |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 option = String(begin, length); | 179 option = String(begin, length); |
| 180 return position + 1; | 180 return position + 1; |
| 181 } | 181 } |
| 182 | 182 |
| 183 | 183 |
| 184 bool isValidHTTPHeaderValue(const String& name) | 184 bool isValidHTTPHeaderValue(const String& name) |
| 185 { | 185 { |
| 186 // FIXME: This should really match name against | 186 // FIXME: This should really match name against |
| 187 // field-value in section 4.2 of RFC 2616. | 187 // field-value in section 4.2 of RFC 2616. |
| 188 | 188 |
| 189 return name.containsOnlyLatin1() && !name.contains('\r') && !name.contains(' \n') && !name.contains(static_cast<UChar>('\0')); | 189 return name.containsOnlyLatin1() |
|
esprehn
2016/08/09 04:39:04
There's no reason to upcast to UChar here, we just
| |
| 190 && !name.contains('\r') | |
| 191 && !name.contains('\n') | |
| 192 && !name.contains('\0'); | |
| 190 } | 193 } |
| 191 | 194 |
| 192 // See RFC 7230, Section 3.2. | 195 // See RFC 7230, Section 3.2. |
| 193 // Checks whether |value| matches field-content in RFC 7230. | 196 // Checks whether |value| matches field-content in RFC 7230. |
| 194 // link: http://tools.ietf.org/html/rfc7230#section-3.2 | 197 // link: http://tools.ietf.org/html/rfc7230#section-3.2 |
| 195 bool isValidHTTPFieldContentRFC7230(const String& value) | 198 bool isValidHTTPFieldContentRFC7230(const String& value) |
| 196 { | 199 { |
| 197 if (value.isEmpty()) | 200 if (value.isEmpty()) |
| 198 return false; | 201 return false; |
| 199 | 202 |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 746 if (option == Suborigin::SuboriginPolicyOptions::None) | 749 if (option == Suborigin::SuboriginPolicyOptions::None) |
| 747 messages.append("Ignoring unknown suborigin policy option " + option Name + "."); | 750 messages.append("Ignoring unknown suborigin policy option " + option Name + "."); |
| 748 else | 751 else |
| 749 suborigin->addPolicyOption(option); | 752 suborigin->addPolicyOption(option); |
| 750 } | 753 } |
| 751 | 754 |
| 752 return true; | 755 return true; |
| 753 } | 756 } |
| 754 | 757 |
| 755 } // namespace blink | 758 } // namespace blink |
| OLD | NEW |