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

[BUG] Headers not available #231

Closed
philschmid opened this issue Jul 12, 2022 · 2 comments · Fixed by #232
Closed

[BUG] Headers not available #231

philschmid opened this issue Jul 12, 2022 · 2 comments · Fixed by #232

Comments

@philschmid
Copy link

Description
Headers are not passed into request object.

service

import logging
from robyn import Robyn

logger = logging.getLogger(__name__)
logging.basicConfig(format="%(asctime)s | %(name)s | %(levelname)s | %(message)s", level=logging.INFO)

app = Robyn(__file__)


@app.post("/test")
async def predict(request):
    logger.info(request)
    return "OK"


app.start(port=5000)

Example request

curl --request POST \
  --url http://localhost:5000/test \
  --header 'Content-Type: application/json' \
  --data '{
        "inputs": "test"
}'

Logs of request

2022-07-12 19:43:40,402 | __main__ | INFO | {'params': {}, 'headers': {}, 'body': [123, 10, 9, 34, 105, 110, 112, 117, 116, 115, 34, 58, 32, 34, 116, 101, 115, 116, 34, 10, 125], 'queries': {}}
2022-07-12 19:43:40,402 | __main__ | ERROR | 'dict' object has no attribute 'headers'

Environment:

  • Host OS: ubuntu
  • version: 0.17.0
@sansyrox
Copy link
Member

@philschmid , thank you for reporting the error. And this is a very big bug. It shouldn't have happened. I'll try to fix it asap.

@sansyrox
Copy link
Member

@philschmid , this has been fixed and will be released in v0.17.1. But, now something else has failed and I am at a conference(i.e. with limited access). So, it might take till this weekend to be released.

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

Successfully merging a pull request may close this issue.

2 participants