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

feat: handle url limit in rest #3186

Merged
merged 7 commits into from
Oct 4, 2024
Merged

feat: handle url limit in rest #3186

merged 7 commits into from
Oct 4, 2024

Conversation

Hardikl
Copy link
Contributor

@Hardikl Hardikl commented Oct 1, 2024

This change would be in build() function which would be called by rest cli and rest/ems collector calls.

@cla-bot cla-bot bot added the cla-signed label Oct 1, 2024
@Hardikl Hardikl linked an issue Oct 1, 2024 that may be closed by this pull request
cmd/tools/rest/href_builder.go Outdated Show resolved Hide resolved
b.fields = []string{"*"}
}

if len(b.hiddenFields) > 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If hidden fields are added below the URLMaxLimit check, they may cause the URL to exceed the max. Hidden fields need to be part of the max check

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 was thinking that, if hiddenFields would be prior then if it exceed the limit, then it will pass * and no hidden fields would be coming in that response.
But yeah, if it was in later then url rest limit 414 error will come and whole rest call would be failed.

cmd/tools/rest/href_builder_test.go Outdated Show resolved Hide resolved
cmd/tools/rest/href_builder_test.go Outdated Show resolved Hide resolved
cmd/tools/rest/href_builder_test.go Outdated Show resolved Hide resolved
@cgrinds cgrinds merged commit 5f6ef52 into main Oct 4, 2024
6 checks passed
@cgrinds cgrinds deleted the hl_rest_limit branch October 4, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Harvest should handle HTTP 414 responses from REST endpoints
3 participants