Skip to content

Commit

Permalink
Do not trim user input before submitting.
Browse files Browse the repository at this point in the history
  • Loading branch information
noordawod committed Dec 20, 2021
1 parent 4adb204 commit 5493205
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class ApiKeyAuth implements Authentication {
@override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
apiKeyPrefix = apiKeyPrefix.trim();
final paramValue = (apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey').trim();
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
if (paramValue.isNotEmpty) {
if (location == 'query') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class HttpBasicAuth implements Authentication {

@override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
username = username.trim();
password = password.trim();
if (username.isNotEmpty && password.isNotEmpty) {
final credentials = '$username:$password';
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ class HttpBearerAuth implements Authentication {
return;
}

accessToken = accessToken.trim();

if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class OAuth implements Authentication {

@override
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
accessToken = accessToken.trim();
if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
}
Expand Down

0 comments on commit 5493205

Please sign in to comment.