Skip to content

Commit 5493205

Browse files
committed
Do not trim user input before submitting.
1 parent 4adb204 commit 5493205

4 files changed

Lines changed: 1 addition & 9 deletions

File tree

modules/openapi-generator/src/main/resources/dart2/auth/api_key_auth.mustache

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class ApiKeyAuth implements Authentication {
1111
1212
@override
1313
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
14-
apiKeyPrefix = apiKeyPrefix.trim();
15-
16-
final paramValue = (apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey').trim();
14+
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
1715
1816
if (paramValue.isNotEmpty) {
1917
if (location == 'query') {

modules/openapi-generator/src/main/resources/dart2/auth/http_basic_auth.mustache

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ class HttpBasicAuth implements Authentication {
88

99
@override
1010
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
11-
username = username.trim();
12-
password = password.trim();
13-
1411
if (username.isNotEmpty && password.isNotEmpty) {
1512
final credentials = '$username:$password';
1613
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';

modules/openapi-generator/src/main/resources/dart2/auth/http_bearer_auth.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class HttpBearerAuth implements Authentication {
3232
return;
3333
}
3434

35-
accessToken = accessToken.trim();
36-
3735
if (accessToken.isNotEmpty) {
3836
headerParams['Authorization'] = 'Bearer $accessToken';
3937
}

modules/openapi-generator/src/main/resources/dart2/auth/oauth.mustache

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class OAuth implements Authentication {
77

88
@override
99
void applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams) {
10-
accessToken = accessToken.trim();
1110
if (accessToken.isNotEmpty) {
1211
headerParams['Authorization'] = 'Bearer $accessToken';
1312
}

0 commit comments

Comments
 (0)