Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Untracking does not remove #13

Closed
Donnie opened this issue Jun 18, 2021 · 4 comments · Fixed by #14
Closed

Untracking does not remove #13

Donnie opened this issue Jun 18, 2021 · 4 comments · Fixed by #14
Labels
bug Something isn't working

Comments

@Donnie
Copy link
Owner

Donnie commented Jun 18, 2021

/untrack donnieashok.in

Would not remove http://donnieashok.in

But it still responds with

Removed!

@Donnie Donnie added the bug Something isn't working label Jun 18, 2021
@Donnie
Copy link
Owner Author

Donnie commented Jun 18, 2021

However it does work as expected in case https websites. Without https being mentioned in the input.

@Donnie
Copy link
Owner Author

Donnie commented Jun 18, 2021

Site: web.Sanitise(m.Payload),

Here web.Sanitise is changing donnie.in to https://donnie.in and successfully deletes https websites even when https is missing in the input.

However, it does not attempt to remove http://donnie.in unless specifically http is used in the input.

Ideally it should try to delete both the http and https websites when the schema is not mentioned in the input.
And be specific when the input is specific.

@Donnie
Copy link
Owner Author

Donnie commented Jun 18, 2021

return web.Scheme + "://" + web.Hostname()

The solution could lie in the fact that instead of returning a string Sanitise can return a structured form of the website.

If structured form is returned than the consumer would be able to get both the http and https version from the same call.

If structured form is returned that the caller will still need to do a line of work converting it into a string.
That can be avoided by returning two strings instead of one as being done currently.
One being the http form and the other being https form, thereby the caller would have the choice to use any or both very easily without any amount of further code.

@Donnie
Copy link
Owner Author

Donnie commented Jun 18, 2021

ManDown/web/web.go

Lines 88 to 89 in 93520e7

if err != nil || site == "" {
return ""

Also while at it the Sanitise could ideally throw an error instead of an empty string, so that the caller can handle this possible error without having to check for length of the output url.

@Donnie Donnie linked a pull request Jun 19, 2021 that will close this issue
Donnie pushed a commit that referenced this issue Jun 19, 2021
* v1.1.2 - Improve web.Sanitise

* v1.1.2 - Update tests

* v1.1.2 - Add error message when wrong input

* v1.1.2 - Update Track

* v1.1.2 - Update Untrack

* v1.1.2 - Update Readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant