Skip to content

Commit

Permalink
Clear fragment from URL
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhiFadlillah committed May 26, 2018
1 parent 1baf921 commit 7532d36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions cmd/cmd-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
3 changes: 2 additions & 1 deletion cmd/serve/web-handler-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 7532d36

Please sign in to comment.