Skip to content

chore(RDGRS-1371): add new flow layer #132

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

OS-kiranmalsetty
Copy link
Contributor

@OS-kiranmalsetty OS-kiranmalsetty commented May 6, 2025

Screenshot 2025-05-08 at 3 45 20 PM

@cssecautomation
Copy link

cssecautomation commented May 6, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

@OS-kiranmalsetty OS-kiranmalsetty marked this pull request as ready for review May 7, 2025 19:47
@OS-kiranmalsetty OS-kiranmalsetty requested a review from a team as a code owner May 7, 2025 19:47
main.go Outdated
@@ -150,7 +153,12 @@ func client(args []string) {

queryParams := generateQueryParameters(localPorts)

config.Server = fmt.Sprintf("%s%s", args[0], queryParams)
//get server URL
restyclient := resty.New()
Copy link
Contributor

Choose a reason for hiding this comment

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

why not inside the func getURL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created the client outside the getURL to test the function with the mocked client.

main.go Outdated
//get server URL
restyclient := resty.New()
//httpClient := &http.Client{}
ServerURL := getURL(restyclient, args[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

ServerURL, why upper case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

must be a typo. Fixed it.

main.go Outdated
@@ -180,6 +188,36 @@ func client(args []string) {
}
}

func getURL(client *resty.Client, requestLocation string) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

getURL it's not the best name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any suggestions for the name?

main.go Outdated
}

// Ensure the URL has a valid scheme
if parsedURL.Scheme != "http" && parsedURL.Scheme != "https" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Without a scheme should be allowed, like localhost:8080


resp, err := client.SetDoNotParseResponse(true).R().Get(parsedURL.String())
if err != nil {
if resp != nil && resp.StatusCode() == http.StatusFound {
Copy link
Contributor

Choose a reason for hiding this comment

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

why validate if resp != nil twice?

Copy link
Contributor Author

@OS-kiranmalsetty OS-kiranmalsetty May 12, 2025

Choose a reason for hiding this comment

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

resp and err are different fields. I want to check the response only when there is an error.

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.

3 participants