hbz / lobid

Linking Open Bibliographic Data
https://lobid.org/
Eclipse Public License 2.0
16 stars 4 forks source link

Validate parameters when using `scroll=true`. #196

Closed fsteeg closed 9 years ago

fsteeg commented 9 years ago

The new chunked response uses a different code path that skipped parameter validation. This allowed requests with unlimited size, see included test for an example.

dr0i commented 9 years ago

size has no impact when using scroll. So there is no need for validation.

fsteeg commented 9 years ago

executeScrollScan calls bulk, which calls startInitialResponse, which calls search, which sets the size on a request and executes it:

https://github.com/hbz/lobid/blob/d9902e7c85999be7e73484467e6aa44292d589a3/app/models/Search.java#L439

dr0i commented 9 years ago

Ah, yes. The first lookup uses indeed size. It is done to get the overall hits. Best would be to hardwire the size to 1 when doing scroll. Doesn't matter much - merging an closing.