OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 2 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 4 * Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
5 * Copyright (C) 2009 Google Inc. All rights reserved. | 5 * Copyright (C) 2009 Google Inc. All rights reserved. |
6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. | 6 * Copyright (C) 2011 Apple Inc. All Rights Reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 || c == '/' || c == '[' || c == ']' || c == '?' || c == '=' | 122 || c == '/' || c == '[' || c == ']' || c == '?' || c == '=' |
123 || c == '{' || c == '}') | 123 || c == '{' || c == '}') |
124 return false; | 124 return false; |
125 } | 125 } |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 static const size_t maxInputSampleSize = 128; | 129 static const size_t maxInputSampleSize = 128; |
130 static String trimInputSample(const char* p, size_t length) | 130 static String trimInputSample(const char* p, size_t length) |
131 { | 131 { |
132 String s = String(p, std::min<size_t>(length, maxInputSampleSize)); | 132 if (length > maxInputSampleSize) { |
133 if (length > maxInputSampleSize) | 133 String s = String(p, std::min<size_t>(length, maxInputSampleSize)) + hor
izontalEllipsis; |
134 s.append(horizontalEllipsis); | 134 return s; |
135 return s; | 135 } |
| 136 return String(p, std::min<size_t>(length, maxInputSampleSize)); |
136 } | 137 } |
137 | 138 |
138 ContentDispositionType contentDispositionType(const String& contentDisposition) | 139 ContentDispositionType contentDispositionType(const String& contentDisposition) |
139 { | 140 { |
140 if (contentDisposition.isEmpty()) | 141 if (contentDisposition.isEmpty()) |
141 return ContentDispositionNone; | 142 return ContentDispositionNone; |
142 | 143 |
143 Vector<String> parameters; | 144 Vector<String> parameters; |
144 contentDisposition.split(';', parameters); | 145 contentDisposition.split(';', parameters); |
145 | 146 |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 | 680 |
680 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body) | 681 size_t parseHTTPRequestBody(const char* data, size_t length, Vector<unsigned cha
r>& body) |
681 { | 682 { |
682 body.clear(); | 683 body.clear(); |
683 body.append(data, length); | 684 body.append(data, length); |
684 | 685 |
685 return length; | 686 return length; |
686 } | 687 } |
687 | 688 |
688 } | 689 } |
OLD | NEW |