Commit 61fec61
committed
refactor: express both Link parsing and the parameter check as the queries they are
CodeQL flagged two loops that filter their sequence implicitly (cs/linq/missed-where,
alerts 293 and 294). Both are mine: 294 is this PR's parameter check, and 293 is the
Link-header loop on master — #264 cleared cs/linq/missed-select there and CodeQL
immediately raised missed-where on the same loop, so the guard-on-the-way-in shape
traded one alert for another rather than fixing the cause.
Splitting the parse of a single RFC 8288 link-value into its own method leaves
ParseLinkHeaderNext reading as what it actually is — the first rel="next" target, if
any — and removes the whole class of finding instead of moving it. The parameter check
becomes the FirstOrDefault it always was; a default KeyValuePair has a null Key, which
is precisely the "no complex parameter" answer.
Behaviour is unchanged: Http 60/60, AspNetCore 159/159.
The explanatory comment moved from between `=>` and the expression into the XML doc —
dotnet format rejects a comment in that position, and it belongs with the rest of the
method's documentation anyway.1 parent 582e355 commit 61fec61
2 files changed
Lines changed: 42 additions & 42 deletions
File tree
- src
- Integrations/NeoReports.AspNetCore
- Sources/NeoReports.Sources.Http
Lines changed: 11 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
1302 | 1309 | | |
1303 | | - | |
1304 | | - | |
1305 | | - | |
1306 | | - | |
1307 | | - | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
1318 | 1314 | | |
1319 | 1315 | | |
1320 | 1316 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
211 | 235 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
237 | 241 | | |
238 | | - | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| |||
0 commit comments