fix bug in header name
This commit is contained in:
@@ -14,7 +14,7 @@ public class NetworkConstants {
|
||||
public static final String PARAM_EXPIRY_HOURS = "expiry_hours";
|
||||
|
||||
// Authentication
|
||||
public static final String CLIENT_KEY_HEADER = "client-key";
|
||||
public static final String CLIENT_KEY_HEADER = "X-Client-Key";
|
||||
|
||||
// Default values
|
||||
public static final int DEFAULT_MAX_DOWNLOADS = 1;
|
||||
|
||||
@@ -109,6 +109,7 @@ public class UploadController {
|
||||
String clientKey = PreferencesUtil.getClientKey(context);
|
||||
|
||||
Log.d(TAG, "Using server URL: " + serverUrl);
|
||||
Log.d(TAG, "Adding header '" + NetworkConstants.CLIENT_KEY_HEADER + "' with value: " + clientKey);
|
||||
|
||||
// Build request with client-key header
|
||||
Request request = new Request.Builder()
|
||||
@@ -159,6 +160,7 @@ public class UploadController {
|
||||
if (response.code() == 401 || response.code() == 403) {
|
||||
errorMsg = "Authentication failed. Please check client key.";
|
||||
Log.e(TAG, "Authentication error: " + response.code() + ", Body: " + errorBody);
|
||||
Log.e(TAG, "Header sent: " + NetworkConstants.CLIENT_KEY_HEADER + ": " + clientKey);
|
||||
} else {
|
||||
errorMsg = "Upload failed, Response code: " + response.code();
|
||||
Log.e(TAG, errorMsg + ", Body: " + errorBody);
|
||||
|
||||
Reference in New Issue
Block a user