| | 8 | """A checker for CherryPy sites and their mounted applications. |
|---|
| | 9 | |
|---|
| | 10 | on: set this to False to turn off the checker completely. |
|---|
| | 11 | |
|---|
| | 12 | When this object is called at engine startup, it executes each |
|---|
| | 13 | of its own methods whose names start with "check_". If you wish |
|---|
| | 14 | to disable selected checks, simply add a line in your global |
|---|
| | 15 | config which sets the appropriate method to False: |
|---|
| | 16 | |
|---|
| | 17 | [global] |
|---|
| | 18 | checker.check_skipped_app_config = False |
|---|
| | 19 | |
|---|
| | 20 | You may also dynamically add or replace check_* methods in this way. |
|---|
| | 21 | """ |
|---|
| 223 | | |
|---|
| 224 | | |
|---|
| | 237 | |
|---|
| | 238 | |
|---|
| | 239 | # -------------------- Specific config warnings -------------------- # |
|---|
| | 240 | |
|---|
| | 241 | def check_localhost(self): |
|---|
| | 242 | """Warn if any socket_host is 'localhost'. See #711.""" |
|---|
| | 243 | for k, v in cherrypy.config.iteritems(): |
|---|
| | 244 | if k == 'server.socket_host' and v == 'localhost': |
|---|
| | 245 | warnings.warn("The use of 'localhost' as a socket host can " |
|---|
| | 246 | "cause problems on newer systems, since 'localhost' can " |
|---|
| | 247 | "map to either an IPv4 or an IPv6 address. You should " |
|---|
| | 248 | "use '127.0.0.1' or '[::1]' instead.") |
|---|