-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTTP header field names should be case independent
See https://www.rfc-editor.org/rfc/rfc2616#section-4.2 In the nextcloud notes android app relying on cased headers lead to the app always downloading every note ever written if a reverse proxy automatically converted all proxied headers to lowercase (cloudflare for example does this). See nextcloud/notes-android#2531
- Loading branch information
Showing
2 changed files
with
21 additions
and
5 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
lib/src/main/java/com/nextcloud/android/sso/api/Headers.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.nextcloud.android.sso.api; | ||
|
||
import androidx.annotation.NonNull; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class Headers { | ||
private final Map<String, String> headers = new HashMap<>(); | ||
|
||
public void put(String key, String value) { | ||
headers.put(key.toLowerCase(), value); | ||
} | ||
|
||
public String get(String key) { | ||
return headers.get(key.toLowerCase()); | ||
} | ||
} |
This file contains 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