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

feature(backend): defaulting url trigger to http if no scheme is present #2384

Merged

Conversation

xoscar
Copy link
Contributor

@xoscar xoscar commented Apr 13, 2023

This PR adds the http scheme for URLs that doesn't have it already

Changes

  • Updates http trigger to add scheme if not present

Fixes

Checklist

  • tested locally
  • added new dependencies
  • updated the docs
  • added a test

https://www.loom.com/share/e435543d25e741089e5b7f70fa123228

@xoscar xoscar added the backend label Apr 13, 2023
@xoscar xoscar requested a review from schoren April 13, 2023 22:21
@xoscar xoscar self-assigned this Apr 13, 2023
@xoscar xoscar linked an issue Apr 13, 2023 that may be closed by this pull request
@xoscar xoscar marked this pull request as ready for review April 13, 2023 22:21
}

if parsedUrl.Scheme == "" {
parsedUrl.Scheme = "http"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have a constant for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think a constant is needed here. it's not a value that will be referenced any other place, it's just a default used in this only context.

return response, err
}

if parsedUrl.Scheme == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to test an edge case: if the address comes with a :443, should we change this scheme to https?

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 think that's just a really weird use case, here's what postman shows
Screenshot 2023-04-14 at 10 03 19

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case, we can live with that situation.

@xoscar xoscar merged commit fc49f09 into main Apr 14, 2023
@xoscar xoscar deleted the 2374-need-input-validation-on-url-field-of-http-request-trigger branch April 14, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Need input validation on url field of http request trigger
4 participants