OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef NET_BASE_NET_UTIL_H_ | 5 #ifndef NET_BASE_NET_UTIL_H_ |
6 #define NET_BASE_NET_UTIL_H_ | 6 #define NET_BASE_NET_UTIL_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #ifdef OS_WIN | 10 #ifdef OS_WIN |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 std::string CanonicalizeHost(const std::wstring& host, | 158 std::string CanonicalizeHost(const std::wstring& host, |
159 url_canon::CanonHostInfo* host_info); | 159 url_canon::CanonHostInfo* host_info); |
160 | 160 |
161 // Returns true if |host| is not an IP address and is compliant with a set of | 161 // Returns true if |host| is not an IP address and is compliant with a set of |
162 // rules based on RFC 1738 and tweaked to be compatible with the real world. | 162 // rules based on RFC 1738 and tweaked to be compatible with the real world. |
163 // The rules are: | 163 // The rules are: |
164 // * One or more components separated by '.' | 164 // * One or more components separated by '.' |
165 // * Each component begins and ends with an alphanumeric character | 165 // * Each component begins and ends with an alphanumeric character |
166 // * Each component contains only alphanumeric characters and '-' or '_' | 166 // * Each component contains only alphanumeric characters and '-' or '_' |
167 // * The last component does not begin with a digit | 167 // * The last component does not begin with a digit |
| 168 // * Optional trailing dot after last component (means "treat as FQDN") |
168 // | 169 // |
169 // NOTE: You should only pass in hosts that have been returned from | 170 // NOTE: You should only pass in hosts that have been returned from |
170 // CanonicalizeHost(), or you may not get accurate results. | 171 // CanonicalizeHost(), or you may not get accurate results. |
171 bool IsCanonicalizedHostCompliant(const std::string& host); | 172 bool IsCanonicalizedHostCompliant(const std::string& host); |
172 | 173 |
173 // Call these functions to get the html snippet for a directory listing. | 174 // Call these functions to get the html snippet for a directory listing. |
174 // The return values of both functions are in UTF-8. | 175 // The return values of both functions are in UTF-8. |
175 std::string GetDirectoryListingHeader(const string16& title); | 176 std::string GetDirectoryListingHeader(const string16& title); |
176 | 177 |
177 // Given the name of a file in a directory (ftp or local) and | 178 // Given the name of a file in a directory (ftp or local) and |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 // Strip the portions of |url| that aren't core to the network request. | 258 // Strip the portions of |url| that aren't core to the network request. |
258 // - user name / password | 259 // - user name / password |
259 // - reference section | 260 // - reference section |
260 GURL SimplifyUrlForRequest(const GURL& url); | 261 GURL SimplifyUrlForRequest(const GURL& url); |
261 | 262 |
262 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); | 263 void SetExplicitlyAllowedPorts(const std::wstring& allowed_ports); |
263 | 264 |
264 } // namespace net | 265 } // namespace net |
265 | 266 |
266 #endif // NET_BASE_NET_UTIL_H_ | 267 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |