Skip to content

fix: url_api field format on news endpoints #452

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

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

tobiasehlert
Copy link
Member

This pull request includes several changes to improve the configuration and initialization of the TibiaData API, as well as enhancements to the user agent generation. The most important changes include adding support for specifying the protocol used by the TibiaData API, refactoring the initialization process, and updating the user agent generator to include protocol information.

Configuration enhancements:

  • src/main.go: Added a new configuration variable TibiaDataProtocol to allow specifying the protocol used by the TibiaData API. This can be overridden by the environment variable TIBIADATA_PROTOCOL.
  • src/main.go: Updated the TibiaDataInitializer function to log the protocol and hostname information.

Initialization refactoring:

  • src/main.go: Refactored the initialization process to ensure the TibiaDataInitializer function is called before generating the user agent and initiating the validator. [1] [2]

User agent generation enhancements:

  • src/webserver.go: Updated the TibiaDataUserAgentGenerator function to include the protocol and hostname in the user agent string if the hostname is set.
  • src/main_test.go: Added tests to verify the user agent generation with and without the hostname and protocol.

API URL construction:

  • src/TibiaNewslist.go: Modified the construction of the ApiURL to include the protocol specified by TibiaDataProtocol.

fix #450

@tobiasehlert tobiasehlert added enhancement New feature or request go Pull requests that update Go code labels Feb 26, 2025
@tobiasehlert tobiasehlert self-assigned this Feb 26, 2025
Copy link

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 55.17241% with 13 lines in your changes missing coverage. Please review.

Project coverage is 80.19%. Comparing base (c961dd5) to head (6ff3bb5).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #452      +/-   ##
==========================================
+ Coverage   79.80%   80.19%   +0.39%     
==========================================
  Files          22       22              
  Lines        3654     3666      +12     
==========================================
+ Hits         2916     2940      +24     
+ Misses        600      585      -15     
- Partials      138      141       +3     

@tobiasehlert tobiasehlert merged commit 6187ad5 into main Feb 26, 2025
8 checks passed
@tobiasehlert tobiasehlert deleted the fix-url_api-field-format-on-news-endpoints branch February 26, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

bug: url_api field in news entry wrong formatted
1 participant