JsonPlaceHolder does not validate URLs correctly [Konkrete]
Codestian opened this issue ยท 1 comments
Describe the bug
The jsonPlaceHolder placeholder for text does not validate URLs correctly. Instead of showing the response from the URL, it only shows the variable code ({"placeholder":"json","values":{"json_path":"$.KEY","source":"URL"}}). However, when the if else statement as shown below is removed and the cachedPlaceHolders.put() method is run, it is able to retrieve data from the URL successfully. The issue stems not from FancyMenu, but Konkrete library, specifically WebUtils.class and method isValidUrl.
To Reproduce
Steps to reproduce the behavior (e.g.):
- Create text element
- Set text content and select Advanced>JSON Parser
- Set the URL as "https://api.buildtheearth.net/api/v1/buildteams/43c98aab-e2d1-4a78-8c91-1a3218839e0d"
- Set json_path as "$.name"
- Click done to view. No data is shown.
- Replace line 148 with the code from 145 in customization>placeholder>placeholders>advanced>JsonPlaceholder.java
- Repeat steps 1-5 and data from URL is retrieved.
Expected behavior
The URL should be validated and data is retrieved.
Game Log
Only relevant logs are below.
Screenshots
If screenshots would help to explain the issue, please include these.
Basic Informations (please complete the following information):
- OS: Pop!OS
- FancyMenu Version [v3.3.2]
- Forge/Fabric Version [0.104.0+1.21.1]
- Minecraft Version [1.21.1]
- Active Mods [ModMenu]