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

add user-agent header and set application name #2

Merged
merged 2 commits into from
Sep 29, 2024

Conversation

999eagle
Copy link
Contributor

@999eagle 999eagle commented Aug 16, 2024

this pr first adds a builder pattern to OpenShockAPI so OpenShockAPI::new doesn't need to have more optional arguments added and becomes unwieldy.
the second commit then adds an option to configure the application name/version in the builder. this information is used in the user agent (if configured) similarly to what the official C# API bindings do. the application name is also passed as custom_name in post_control so the correct application name shows up the the logs on the OpenShock dashboard.

the introduction of this builder pattern might be a bit too much? feel free to give feedback!

@LostQuasar
Copy link
Owner

Not sure how i feel about this build Ill test out the changes on my personal project i use this for and get back to you about this PR

src/api.rs Outdated
}
app_name
} else {
"rusty".to_string()
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
"rusty".to_string()
"rzap".to_string()

This makes more sense than what I originally had it. Also might be worth appending the version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, changed the text. the version probably shouldn't be listed here because this text is what's shown in the openshock dashboard's log view and nothing else seems to add a version there.

@LostQuasar
Copy link
Owner

Looks great to me I'll run some tests and figure out the changes and merge/release a new version

@LostQuasar LostQuasar merged commit dacc111 into LostQuasar:main Sep 29, 2024
1 check failed
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