jarrodek / ChromeRestClient

ARC Chrome is deprecated. Please move to https://github.com/advanced-rest-client/arc-electron/
Apache License 2.0
370 stars 98 forks source link

400 Bad Request Error #690

Open kiwi64 opened 8 years ago

kiwi64 commented 8 years ago

Hi, Last week either wed or thurs I started get a 400 error when using ARC. The previous night I was successfully able to check some calls, but now I'm getting this and cannot understand why..when calls previously work and I made no changes to the tool...this is what I get in request of 400 error: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

400 Bad Request

Bad Request

Your browser sent a request that this server could not understand.
Size of a request header field exceeds server limit.

cookie

Can you please tell me what changed with the tool? And mainly how to make it work again without reinstalling. I have history and projects I don't want to lose.

jarrodek commented 8 years ago

Hi,

There were no changes to the app recently. Can you paste request headers string you send with this request? Especially "cookie" part.

robjanssen commented 8 years ago

I think I found out what happens - in my case, every time the server sends a Set-Cookie response back, it's appended to the Cookie header that's sent with the request. There's no way to override this or to clear the cookie that's sent, so eventually any server is going to complain with a 400 error. I can post the contents but it basically doesn't matter - just put a very long string there.

I found out that deinstalling and reinstalling it manages to clear it, however, so that's a kind of a workaround, but a way to flush this would be of course very much appreciated :smile:

jarrodek commented 8 years ago

Thanks for explanation. You can clear cookie storage in settings. It's faster than reinstalling the app.

It looks like an error in cookie storage. However I can't reproduce the problem. The server must respond with different cookie name each time you hit the endpoint. When the cookie is about to be stored in the datastore, cookie store checks if the cookie is already in the store (for given name, domain and path). If cookie exists, the value is overwritten or new cookie is added otherwise.

You can try debug the apps to get access to the database to check how cookies are stored there. If you find anything that shouldn't be here let me know.