Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexMany() result in an 411 if IEnumerable<T> is empty #303

Closed
salyh opened this issue Jul 4, 2013 · 1 comment
Closed

IndexMany() result in an 411 if IEnumerable<T> is empty #303

salyh opened this issue Jul 4, 2013 · 1 comment

Comments

@salyh
Copy link

salyh commented Jul 4, 2013

IQueryable<Entity> ents = ...
IBulkResponse res = client.IndexMany(ents, npindexname, "objects");

generates an empty POST _bulk request if ents is empty:

POST http://myhost/nonephoneticindex/_bulk HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: myhost
Proxy-Connection: Keep-Alive
empty

The result is

HTTP/1.0 411 Length Required
Server: squid/2.6.STABLE18
Date: Thu, 04 Jul 2013 13:55:27 GMT
Content-Type: text/html
Content-Length: 1522
Expires: Thu, 04 Jul 2013 13:55:27 GMT
X-Squid-Error: ERR_INVALID_REQ 0
X-Cache: MISS from webproxy.myorganization.com
X-Cache-Lookup: NONE from webproxy.myorganization.com:80
Proxy-Connection: close
some html ...

@Mpdreamz
Copy link
Member

Hey @salyh thanks for reporting.

Not all the bulk generation routines handled an empty collection correctly some only checked for null. This is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants