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

Explota cuando el Content-Type no es JSON. #24

Open
sportelliluciano opened this issue Jun 1, 2020 · 0 comments
Open

Explota cuando el Content-Type no es JSON. #24

sportelliluciano opened this issue Jun 1, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@sportelliluciano
Copy link
Member

Este comando:

$ curl -v localhost:28080/usuario/sesion -d '{"email":"[email protected]", "password":"lucho"}'

Genera esto:

  ...
  File "/var/www/app/src/app/resources/sesion.py", line 8, in post
    email = post_data['email']
TypeError: 'NoneType' object is not subscriptable

-->

Headers enviados:

* Connected to localhost (127.0.0.1) port 28080 (#0)
> POST /usuario/sesion HTTP/1.1
> Host: localhost:28080
> User-Agent: curl/7.65.3
> Accept: */*
> Content-Length: 47
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 47 out of 47 bytes
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 500 INTERNAL SERVER ERROR
< Content-Type: text/html; charset=utf-8
< X-XSS-Protection: 0
< Connection: close
< Server: Werkzeug/1.0.1 Python/3.8.3
< Date: Mon, 01 Jun 2020 17:08:03 GMT

El problema es que se mando mal el Content-Type. De todos modos debería devolver 400 y no 500.

@sportelliluciano sportelliluciano added the bug Something isn't working label Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant