fix: url_api field format on news endpoints#452
Merged
tobiasehlert merged 1 commit intomainfrom Feb 26, 2025
Merged
Conversation
|
Codecov ReportAttention: Patch coverage is
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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 variableTibiaDataProtocolto allow specifying the protocol used by the TibiaData API. This can be overridden by the environment variableTIBIADATA_PROTOCOL.src/main.go: Updated theTibiaDataInitializerfunction to log the protocol and hostname information.Initialization refactoring:
src/main.go: Refactored the initialization process to ensure theTibiaDataInitializerfunction is called before generating the user agent and initiating the validator. [1] [2]User agent generation enhancements:
src/webserver.go: Updated theTibiaDataUserAgentGeneratorfunction 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 theApiURLto include the protocol specified byTibiaDataProtocol.fix #450