deslashify removes slashes and encrypted file extensions from the string. This is the inverse of slashify().
(s string)
| 636 | // deslashify removes slashes and encrypted file extensions from the string. |
| 637 | // This is the inverse of slashify(). |
| 638 | func deslashify(s string) (string, error) { |
| 639 | if s == "" || !strings.HasPrefix(s[1:], encryptedDirExtension) { |
| 640 | return "", fmt.Errorf("invalid encrypted path: %q", s) |
| 641 | } |
| 642 | s = s[:1] + s[1+len(encryptedDirExtension):] |
| 643 | return strings.ReplaceAll(s, "/", ""), nil |
| 644 | } |
| 645 | |
| 646 | type rawResponse struct { |
| 647 | data []byte |