Clear fragment from URL

This commit is contained in:
Radhi Fadlillah 2018-05-26 21:11:02 +07:00
parent 1baf921b49
commit 7532d36e7e
2 changed files with 8 additions and 4 deletions

View file

@ -43,7 +43,8 @@ func (h *cmdHandler) addBookmark(cmd *cobra.Command, args []string) {
return
}
// Clear UTM parameters from URL
// Clear fragment and UTM parameters from URL
parsedURL.Fragment = ""
clearUTMParams(parsedURL)
// Create bookmark item
@ -238,7 +239,8 @@ func (h *cmdHandler) updateBookmarks(cmd *cobra.Command, args []string) {
return
}
// Clear UTM parameters from URL
// Clear fragment and UTM parameters from URL
parsedURL.Fragment = ""
clearUTMParams(parsedURL)
url = parsedURL.String()
@ -623,7 +625,8 @@ func (h *cmdHandler) importBookmarks(cmd *cobra.Command, args []string) {
continue
}
// Clear UTM parameters from URL
// Clear fragment and UTM parameters from URL
parsedURL.Fragment = ""
clearUTMParams(parsedURL)
book.URL = parsedURL.String()

View file

@ -111,7 +111,8 @@ func (h *webHandler) apiInsertBookmark(w http.ResponseWriter, r *http.Request, p
panic(fmt.Errorf("URL is not valid"))
}
// Clear UTM parameter from URL
// Clear fragment and UTM parameters from URL
parsedURL.Fragment = ""
clearUTMParams(parsedURL)
book.URL = parsedURL.String()