Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,16 +11,12 @@ def index():
|
|
| 11 |
@app.route('/<path:subpath>', methods=['POST'])
|
| 12 |
def forward_to_target(subpath):
|
| 13 |
try:
|
| 14 |
-
# 构建目标 URL
|
| 15 |
-
target_url = f'https://{subpath}'
|
| 16 |
-
print(f"Target URL: {target_url}") # 调试信息
|
| 17 |
-
|
| 18 |
# 获取请求数据
|
| 19 |
data = request.json
|
| 20 |
print(f"Request data: {data}") # 调试信息
|
| 21 |
|
| 22 |
# 检查是否是特定路径需要特殊处理
|
| 23 |
-
if
|
| 24 |
auth_header = request.headers.get('Authorization')
|
| 25 |
if not auth_header or not auth_header.startswith('Bearer '):
|
| 26 |
return jsonify({"error": "Unauthorized"}), 401
|
|
|
|
| 11 |
@app.route('/<path:subpath>', methods=['POST'])
|
| 12 |
def forward_to_target(subpath):
|
| 13 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# 获取请求数据
|
| 15 |
data = request.json
|
| 16 |
print(f"Request data: {data}") # 调试信息
|
| 17 |
|
| 18 |
# 检查是否是特定路径需要特殊处理
|
| 19 |
+
if True:
|
| 20 |
auth_header = request.headers.get('Authorization')
|
| 21 |
if not auth_header or not auth_header.startswith('Bearer '):
|
| 22 |
return jsonify({"error": "Unauthorized"}), 401
|