| 174 | } |
| 175 | |
| 176 | func cleanHeader(headField string) string { |
| 177 | // ok - remove any spaces and replace with _ |
| 178 | headField = strings.Replace(headField, " ", "_", -1) |
| 179 | // ok - remove any | and replace with _ |
| 180 | headField = strings.Replace(headField, "|", "_", -1) |
| 181 | // ok - remove any - and replace with _ |
| 182 | headField = strings.Replace(headField, "-", "_", -1) |
| 183 | // ok - remove any + and replace with _ |
| 184 | headField = strings.Replace(headField, "+", "_", -1) |
| 185 | // ok - remove any @ and replace with _ |
| 186 | headField = strings.Replace(headField, "@", "_", -1) |
| 187 | // ok - remove any # and replace with _ |
| 188 | headField = strings.Replace(headField, "#", "_", -1) |
| 189 | // ok - remove any / and replace with _ |
| 190 | headField = strings.Replace(headField, "/", "_", -1) |
| 191 | // ok - remove any \ and replace with _ |
| 192 | headField = strings.Replace(headField, "\\", "_", -1) |
| 193 | // ok - remove any : and replace with _ |
| 194 | headField = strings.Replace(headField, ":", "_", -1) |
| 195 | // ok - remove any ( and replace with _ |
| 196 | headField = strings.Replace(headField, "(", "_", -1) |
| 197 | // ok - remove any ) and replace with _ |
| 198 | headField = strings.Replace(headField, ")", "_", -1) |
| 199 | // ok - remove any ' and replace with _ |
| 200 | headField = strings.Replace(headField, "'", "_", -1) |
| 201 | return headField |
| 202 | } |