Skip to content

Commit

Permalink
fix: prevent scheme confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
knrdl committed Nov 28, 2024
1 parent 0d2e7af commit 9489dd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/acme/account/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ async def create_or_view_account(

@api.post('/key-change')
async def change_key(data: Annotated[RequestData, Depends(SignedRequest())]):
raise ACMEException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, exctype='serverInternal', detail='not implemented', new_nonce=data.new_nonce) # todo
"""not implemented"""
raise ACMEException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, exctype='serverInternal', detail='not implemented', new_nonce=data.new_nonce)


@api.post('/accounts/{acc_id}')
Expand Down
2 changes: 1 addition & 1 deletion app/acme/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(
def _schemeless_url(url: str):
if url.startswith('https://'):
return url.removeprefix('https://')
if url.startswith('http://'):
elif url.startswith('http://'):
return url.removeprefix('http://')
return url

Expand Down

0 comments on commit 9489dd2

Please sign in to comment.