| 157 | } |
| 158 | |
| 159 | String |
| 160 | canonicalEncode(const String &in, bool isObjectName) |
| 161 | { |
| 162 | String canonical; |
| 163 | if (!isUriEncoded(in, isObjectName)) { |
| 164 | /* Not URI-encoded */ |
| 165 | canonical = uriEncode(in, isObjectName); |
| 166 | } else { |
| 167 | /* URI-encoded, then don't encode since AWS does not encode which is not mentioned in the spec, |
| 168 | * asked AWS, still waiting for confirmation */ |
| 169 | canonical = in; |
| 170 | } |
| 171 | |
| 172 | return canonical; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * @brief Trim white spaces from beginning and end. Squeeze consecutive spaces from middle. |
no test coverage detected