mirror of
https://github.com/fastapi/fastapi.git
synced 2026-01-24 22:12:45 -05:00
✨ Add HTTPException with custom headers (#35)
* 📝 Update Release Notes with issue templates * ✨ Add HTTPException with support for headers Including docs and tests * 📝 Update Security docs to use new HTTPException
This commit is contained in:
committed by
GitHub
parent
7edbd9345b
commit
8772e2f2ee
@@ -1,12 +1,11 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
import jwt
|
||||
from fastapi import Depends, FastAPI, Security
|
||||
from fastapi import Depends, FastAPI, Security, HTTPException
|
||||
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
|
||||
from jwt import PyJWTError
|
||||
from passlib.context import CryptContext
|
||||
from pydantic import BaseModel
|
||||
from starlette.exceptions import HTTPException
|
||||
from starlette.status import HTTP_403_FORBIDDEN
|
||||
|
||||
# to get a string like this run:
|
||||
|
||||
Reference in New Issue
Block a user