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

carlota #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

carlota #9

wants to merge 1 commit into from

Conversation

carlotaarvela
Copy link

No description provided.

Copy link
Collaborator

@tomw-1 tomw-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


defer client.Close()

name := strings.ReplaceAll(params["name"], "%20"," ")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://pkg.go.dev/net/url#QueryUnescape would do this for all url encoded chars, rather than just replacing %20 with a space

w.WriteHeader(http.StatusBadRequest)
return
}
HandleError(err, w)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think HandleError needs to be a public method (starting with a H rather than a h).

If err was an error, it would write the error and set the header, but continue on with the rest of the method anyway. You would probably have to move the if block from the handleError method up to this call and have the handleError then write the response and the header

if err != nil {
handleError(err, w)
return
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants