Added / to the Endpoints so Flask does NOT deny every request with it added...

This commit is contained in:
ZKWolf 2023-09-11 17:44:32 +02:00
parent 97e9026570
commit 6dbcfb5d87
6 changed files with 53 additions and 54 deletions

View File

@ -4,7 +4,7 @@ import os
from logic.mongodb_handler import mongo
@app.route("/gamenews/messages", methods=["GET"])
@app.route("/gamenews/messages/", methods=["GET"])
def gamenews():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -27,7 +27,7 @@ def gamenews():
logger.graylog_logger(level="error", handler="general-Game-News", message=e)
@app.route("/api/v1/config/VER_LATEST_CLIENT_DATA", methods=["GET"])
@app.route("/api/v1/config/VER_LATEST_CLIENT_DATA/", methods=["GET"])
def config_ver_latest_client_data():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -41,7 +41,7 @@ def config_ver_latest_client_data():
logger.graylog_logger(level="error", handler="general-ver-latest-data", message=e)
@app.route("/api/v1/utils/contentVersion/latest/<version>", methods=["GET"])
@app.route("/api/v1/utils/contentVersion/latest/<version>/", methods=["GET"])
def content_version_latest(version):
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -97,7 +97,7 @@ def gameservers_live():
logger.graylog_logger(level="error", handler="general-gameserver-dev", message=e)
@app.route("/api/v1/config/UseMirrorsMM_Steam", methods=["GET"]) # What is this even???
@app.route("/api/v1/config/UseMirrorsMM_Steam/", methods=["GET"]) # What is this even??? Maybe Use Matchmaking? Its only in old Versions tho...
def config_use_mirrors_mm_steam():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -111,7 +111,7 @@ def config_use_mirrors_mm_steam():
logger.graylog_logger(level="error", handler="general-use-mirrors-mm-steam", message=e)
@app.route("/crashreport/unreal/CrashReporter/Ping", methods=["GET"])
@app.route("/crashreport/unreal/CrashReporter/Ping/", methods=["GET"])
def crashreporter_ping():
check_for_game_client("soft")
try:
@ -122,7 +122,7 @@ def crashreporter_ping():
logger.graylog_logger(level="error", handler="general-crashreporter-ping", message=e)
@app.route("/tex", methods=["GET"])
@app.route("/tex/", methods=["GET"])
def tex_get():
check_for_game_client("soft")
try:
@ -145,7 +145,7 @@ def favicon():
logger.graylog_logger(level="error", handler="general-favicon", message=e)
@app.route("/api/v1/healthcheck", methods=["GET"])
@app.route("/api/v1/healthcheck/", methods=["GET"])
def healthcheck():
check_for_game_client("soft")
try:
@ -158,7 +158,7 @@ def healthcheck():
logger.graylog_logger(level="error", handler="general-healthcheck", message=e)
@app.route("/api/v1/services/tex")
@app.route("/api/v1/services/tex/")
def services_tex():
try:
return {"current-event": {"status": {"id": "live"}, "message": ""}} # Alpha 2 WARNING Msg text?!?!
@ -171,7 +171,7 @@ def services_tex():
logger.graylog_logger(level="error", handler="general-services-tex", message=e)
@app.route("/api/v1/consent/eula2", methods=["PUT", "GET"])
@app.route("/api/v1/consent/eula2/", methods=["PUT", "GET"])
def consent_eula():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -223,7 +223,7 @@ def consent_eula():
logger.graylog_logger(level="error", handler="general-consent-eula", message=e)
@app.route("/api/v1/consent/eula", methods=["GET"])
@app.route("/api/v1/consent/eula/", methods=["GET"])
def consent_eula0():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -238,7 +238,7 @@ def consent_eula0():
logger.graylog_logger(level="error", handler="general-consent-eula0", message=e)
@app.route("/api/v1/consent/privacyPolicy", methods=["GET"])
@app.route("/api/v1/consent/privacyPolicy/", methods=["GET"])
def privacy_policy():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -253,7 +253,7 @@ def privacy_policy():
logger.graylog_logger(level="error", handler="general-privacy-policy", message=e)
@app.route("/api/v1/extensions/leaderboard/getScores", methods=["GET", "POST"])
@app.route("/api/v1/extensions/leaderboard/getScores/", methods=["GET", "POST"])
def leaderboard_get_scores():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -281,7 +281,7 @@ def submit():
return "Discarded=1"
@app.route("/api/v1/extensions/quitters/getQuitterState", methods=["POST"])
@app.route("/api/v1/extensions/quitters/getQuitterState/", methods=["POST"])
def get_quitter_state():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")

View File

@ -1,7 +1,7 @@
from flask_definitions import *
@app.route("/metrics/client/event", methods=["POST"])
@app.route("/metrics/client/event/", methods=["POST"])
def receive_event():
check_for_game_client()
try:
@ -14,7 +14,7 @@ def receive_event():
logger.graylog_logger(level="error", handler="logging_client_Event", message=e)
@app.route("/metrics/httplog/event", methods=["POST"])
@app.route("/metrics/httplog/event/", methods=["POST"])
def metrics_httplog_event():
check_for_game_client()
try:
@ -27,7 +27,7 @@ def metrics_httplog_event():
logger.graylog_logger(level="error", handler="logging_httplog_Event", message=e)
@app.route("/api/v1/gameDataAnalytics", methods=["POST"])
@app.route("/api/v1/gameDataAnalytics/", methods=["POST"])
def analytics_post():
check_for_game_client()
try:
@ -40,7 +40,7 @@ def analytics_post():
logger.graylog_logger(level="error", handler="logging_gameDataAnalytics", message=e)
@app.route("/api/v1/gameDataAnalytics/batch", methods=["POST"])
@app.route("/api/v1/gameDataAnalytics/batch/", methods=["POST"])
def analytics_batch_post():
check_for_game_client()
try:
@ -53,7 +53,7 @@ def analytics_batch_post():
logger.graylog_logger(level="error", handler="logging_gameDataAnalyticsBatch", message=e)
@app.route("/api/v1/me/richPresence", methods=["POST"])
@app.route("/api/v1/me/richPresence/", methods=["POST"])
def me_rich_presence():
check_for_game_client()
try:
@ -65,7 +65,7 @@ def me_rich_presence():
logger.graylog_logger(level="error", handler="logging_meRichPresence", message=e)
@app.route("/metrics/server/event", methods=["POST"])
@app.route("/metrics/server/event/", methods=["POST"])
def metrics_server_event():
check_for_game_client()
try:
@ -77,7 +77,7 @@ def metrics_server_event():
logger.graylog_logger(level="error", handler="logging_server_Event", message=e)
@app.route("/crashreport/unreal/CrashReporter/CheckReport", methods=["POST"])
@app.route("/crashreport/unreal/CrashReporter/CheckReport/", methods=["POST"])
def crashreporter_check_report():
check_for_game_client()
try:

View File

@ -8,7 +8,7 @@ from flask_definitions import *
import uuid
@app.route("/api/v1/config/MATCH_MAKING_REGIONS/raw", methods=["GET"])
@app.route("/api/v1/config/MATCH_MAKING_REGIONS/raw/", methods=["GET"])
def match_making_regions_raw():
check_for_game_client("strict")
try:
@ -19,7 +19,7 @@ def match_making_regions_raw():
logger.graylog_logger(level="error", handler="matchmaking_RegionsRAW", message=e)
@app.route("/api/v1/queue/info", methods=["GET"])
@app.route("/api/v1/queue/info/", methods=["GET"])
def queue_info():
try:
# ?category=Steam-te-23ebf96c-27498-ue4-7172a3f5&gameMode=Default&region=US&countA=1&countB=5
@ -49,7 +49,7 @@ def queue_info():
logger.graylog_logger(level="error", handler="queue_info", message=e)
@app.route("/api/v1/queue", methods=["POST"])
@app.route("/api/v1/queue/", methods=["POST"])
def queue():
# {"category":"Steam-te-18f25613-36778-ue4-374f864b","rank":1,"side":"B","latencies":[],"additionalUserIds":[],
# "checkOnly":false,"gameMode":"08d2279d2ed3fba559918aaa08a73fa8-Default","region":"US","countA":1,"countB":5}
@ -117,7 +117,7 @@ def queue():
# eta, position = match_manager.find_eta_and_position(data["_match_uuid"])
@app.route("/api/v1/queue/cancel", methods=["POST"])
@app.route("/api/v1/queue/cancel/", methods=["POST"])
def cancel_queue():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -132,7 +132,7 @@ def cancel_queue():
return "", 204
@app.route("/api/v1/match/<matchid>", methods=["GET"])
@app.route("/api/v1/match/<matchid>/", methods=["GET"])
def match(matchid):
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -146,7 +146,7 @@ def match(matchid):
return jsonify({"message": "Internal Server Error"}), 500
@app.route("/api/v1/match/<matchid>/Kill", methods=["PUT"])
@app.route("/api/v1/match/<matchid>/Kill/", methods=["PUT"])
def match_kill(matchid):
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -167,7 +167,7 @@ def match_kill(matchid):
return jsonify({"message": "Internal Server Error"}), 500
@app.route("/api/v1/match/<match_id>/register", methods=["POST"])
@app.route("/api/v1/match/<match_id>/register/", methods=["POST"])
def match_register(match_id):
try:
check_for_game_client("strict")
@ -194,7 +194,7 @@ def match_register(match_id):
return jsonify({"message": "Internal Server Error"}), 500
@app.route("/api/v1/match/<match_id>/Quit", methods=["PUT"])
@app.route("/api/v1/match/<match_id>/Quit/", methods=["PUT"])
def match_quit(match_id):
try:
check_for_game_client("strict")
@ -222,7 +222,7 @@ def match_quit(match_id):
return jsonify({"status": "ERROR"}), 500
@app.route("/api/v1/match/create", methods=["POST"])
@app.route("/api/v1/match/create/", methods=["POST"])
def match_create():
# {'category': 'Steam-te-18f25613-36778-ue4-374f864b', 'region': 'US', 'playersA': [],
# 'playersB': ['00658d11-2dfd-41e8-b6d2-2462e8f3aa47', '95041085-e7e4-4759-be3d-e72c69167578',
@ -252,7 +252,7 @@ def match_create():
return jsonify(data)
@app.route("/api/v1/extensions/progression/playerEndOfMatch", methods=["POST"])
@app.route("/api/v1/extensions/progression/playerEndOfMatch/", methods=["POST"])
def progression_player_end_of_match():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -266,7 +266,7 @@ def progression_player_end_of_match():
logger.graylog_logger(level="error", handler="matchmaking_playerEndOfMatch", message=e)
@app.route("/file/<game_version>/<seed>/<map_name>", methods=["POST", "GET"])
@app.route("/file/<game_version>/<seed>/<map_name>/", methods=["POST", "GET"])
def file_gold_rush(seed, map_name, game_version):
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -290,7 +290,7 @@ def file_gold_rush(seed, map_name, game_version):
return {"status": "success"}
@app.route("/metrics/matchmaking/event", methods=["POST"])
@app.route("/metrics/matchmaking/event/", methods=["POST"])
def metrics_matchmaking_event():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")

View File

@ -2,7 +2,7 @@ from flask_definitions import *
# Do NOT change Result to ANYTHING or Add anything before it. Game will crash. Doesnt mean it 100% works tho XD
@app.route("/<game_version>/catalog", methods=["GET"])
@app.route("/<game_version>/catalog/", methods=["GET"])
def catalog_get(game_version):
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")

View File

@ -46,7 +46,7 @@ def steam_login_function():
# This works
@app.route("/api/v1/auth/provider/steam/login", methods=["POST"])
@app.route("/api/v1/auth/provider/steam/login/", methods=["POST"])
def steam_login():
# Read Doc\SteamAuth.md for more information
ip = check_for_game_client("soft")
@ -93,7 +93,7 @@ def steam_login():
# Dont know if this works
@app.route("/api/v1/modifierCenter/modifiers/me", methods=["GET"])
@app.route("/api/v1/modifierCenter/modifiers/me/", methods=["GET"])
def modifiers():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -112,7 +112,7 @@ def modifiers():
# This works
@app.route("/moderation/check/username", methods=["POST"])
@app.route("/moderation/check/username/", methods=["POST"])
def moderation_check_username():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -132,7 +132,7 @@ def moderation_check_username():
# Doesn't work
@app.route("/api/v1/progression/experience", methods=["POST"])
@app.route("/api/v1/progression/experience/", methods=["POST"])
def progression_experience():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -170,7 +170,7 @@ def progression_experience():
logger.graylog_logger(level="error", handler="progression_experience", message=e)
@app.route("/api/v1/extensions/challenges/getChallenges", methods=["POST"])
@app.route("/api/v1/extensions/challenges/getChallenges/", methods=["POST"])
def challenges_get_challenges():
# client: {"data":{"userId":"619d6f42-db87-4f3e-8dc9-3c9995613614","challengeType":"Daily"}}
check_for_game_client("strict")
@ -204,7 +204,7 @@ def challenges_get_challenges():
logger.graylog_logger(level="error", handler="getChallanges", message=e)
@app.route("/api/v1/extensions/challenges/executeChallengeProgressionOperationBatch", methods=["POST"])
@app.route("/api/v1/extensions/challenges/executeChallengeProgressionOperationBatch/", methods=["POST"])
def challenges_execute_challenge_progression_operation_batch():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -226,7 +226,7 @@ def challenges_execute_challenge_progression_operation_batch():
# idk dont think it works
@app.route("/api/v1/inventories", methods=["GET"])
@app.route("/api/v1/inventories/", methods=["GET"])
def inventories():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -249,7 +249,7 @@ def inventories():
# idk if this works
@app.route("/api/v1/players/me/splinteredstates/ProgressionGroups", methods=["GET"])
@app.route("/api/v1/players/me/splinteredstates/ProgressionGroups/", methods=["GET"])
def progression_groups():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -276,7 +276,7 @@ def progression_groups():
# This works
@app.route("/api/v1/players/ban/status", methods=["GET"])
@app.route("/api/v1/players/ban/status/", methods=["GET"])
def ban_status():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -310,7 +310,7 @@ def ban_status():
# broken. no need to fix... OG DG endpoint. Not needed.
@app.route("/api/v1/players/ban/getbaninfo", methods=["GET"])
@app.route("/api/v1/players/ban/getbaninfo/", methods=["GET"])
def get_ban_info():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -326,7 +326,7 @@ def get_ban_info():
# This works
@app.route("/api/v1/wallet/currencies", methods=["GET"])
@app.route("/api/v1/wallet/currencies/", methods=["GET"])
def wallet_currencies():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -353,7 +353,7 @@ def wallet_currencies():
# Does not work. Old DG endpoint. Not needed.
@app.route("/api/v1/wallet/currencies/PROGRESSION_CURRENCY", methods=["GET"])
@app.route("/api/v1/wallet/currencies/PROGRESSION_CURRENCY/", methods=["GET"])
def wallet_currencies_progression():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -368,7 +368,7 @@ def wallet_currencies_progression():
# Dont know if this works. Dont think it does.
@app.route("/api/v1/players/me/splinteredstates/TheExit_Achievements", methods=["GET"])
@app.route("/api/v1/players/me/splinteredstates/TheExit_Achievements/", methods=["GET"])
def achievements_get():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -392,7 +392,7 @@ def achievements_get():
# Does not work
@app.route("/api/v1/messages/count", methods=["GET"])
@app.route("/api/v1/messages/count/", methods=["GET"])
def messages_count():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -410,7 +410,7 @@ def messages_count():
logger.graylog_logger(level="error", handler="messages_count", message=e)
@app.route("/api/v1/messages/list", methods=["GET", "DELETE"])
@app.route("/api/v1/messages/list/", methods=["GET", "DELETE"])
def messages_list():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -460,13 +460,13 @@ def messages_list():
@app.route("/api/v1/messages/v2/markAs", methods=["POST"])
@app.route("/api/v1/messages/v2/markAs/", methods=["POST"])
def messages_mark_as():
return jsonify("", 204)
# Temp response.
@app.route("/moderation/check/chat", methods=["POST"])
@app.route("/moderation/check/chat/", methods=["POST"])
def moderation_check_chat():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -486,7 +486,7 @@ def moderation_check_chat():
# This is intently broken. If this works the game crashes in matchmaking.
@app.route("/api/v1/extensions/progression/initOrGetGroups", methods=["POST"])
@app.route("/api/v1/extensions/progression/initOrGetGroups/", methods=["POST"])
def extension_progression_init_or_get_groups():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -553,7 +553,7 @@ def extension_progression_init_or_get_groups():
# dont know if this works. Hope it does.
@app.route("/api/v1/extensions/inventory/unlockSpecialItems", methods=["POST"])
@app.route("/api/v1/extensions/inventory/unlockSpecialItems/", methods=["POST"])
def inventory_unlock_special_items():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")
@ -568,7 +568,7 @@ def inventory_unlock_special_items():
logger.graylog_logger(level="error", handler="unknown_unlockSpecialItems", message=e)
@app.route("/api/v1/extensions/challenges/getChallengeProgressionBatch", methods=["POST"])
@app.route("/api/v1/extensions/challenges/getChallengeProgressionBatch/", methods=["POST"])
def challenges_get_challenge_progression_batch():
check_for_game_client("strict")
session_cookie = request.cookies.get("bhvrSession")

View File

@ -13,7 +13,6 @@ import endpoints.unknown
import endpoints.user_handeling
import endpoints.general
import endpoints.logging
import endpoints.debug
import endpoints.web
import endpoints.matchmaking