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

Chalice local not working across browsers/tools #628

Closed
variable opened this issue Dec 5, 2017 · 4 comments · Fixed by #659
Closed

Chalice local not working across browsers/tools #628

variable opened this issue Dec 5, 2017 · 4 comments · Fixed by #659

Comments

@variable
Copy link

variable commented Dec 5, 2017

I have the following routes:

@app.route("/item/{item_id}", methods=['GET'])
def view_item(item_id):
    return

When I run chalice local
If I view the page on browser(GET), works fine, but then using POSTMAN to get to the page, I endup with endless wait, but GET on browser still works

restarts chalice local

If I use POSTMAN to GET to the page first, it works, then GET page on browser doesn't work, but POSTMAN GET still works.

@wollerman
Copy link

wollerman commented Dec 5, 2017

Interesting. I just tested and had the same experience. If I go to the terminal running chalice and send a ctrl + c it then returns in whichever second process was started. Somehow the first request is blocking the second request.

It also only seems to happen when the browser becomes involved. Switching between curl and postman doesn't cause an issue for me.

@variable variable changed the title GET and POST not working together Chalice local not working across browsers/tools Dec 5, 2017
@stealthycoin
Copy link
Contributor

Intersting. My guess is that the browser is opening multiple connections at once for efficiency. Probably looking for a favicon.ico due to the GET and this ties up the single threaded http server. I'm not positive though so I will investigate.

@stealthycoin
Copy link
Contributor

Followed up with this, my initial guess was not correct. The reason was simply that when you perform a GET with a browser it holds the connection open, when you close it from the server side it reopens it. So the only request that will go through is the next one from that same socket which the browser reuses. The default http server behavior in Python is to have no timeout on sockets so it will just sit there blocked forever if the browser is closed. I will try to get this fixed shortly.

@Ayushverma8
Copy link

Ayushverma8 commented Feb 27, 2018

You will get API results via Postman if you define Content-Type: application/json or Content-Type: application/javascript.
Other than this please make sure you are calling out right operation i.e. "PUT"/"GET"

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

Successfully merging a pull request may close this issue.

4 participants