mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
Merge commit from fork
* Sanitize error message output Escape HTML characters in error message for security. * Update CHANGELOG.md --------- Co-authored-by: Niko <github@dieserniko.link>
This commit is contained in:
parent
a91d9feb51
commit
880b92d724
@ -18,6 +18,7 @@ Add your changes below.
|
|||||||
|
|
||||||
- Fixed dead link in README.md
|
- Fixed dead link in README.md
|
||||||
- Corrected Spotify/Spotipy typo in documentation
|
- Corrected Spotify/Spotipy typo in documentation
|
||||||
|
- Sanitize HTML error message output for OAuth flow
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ __all__ = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
import html
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
@ -1252,7 +1253,7 @@ class RequestHandler(BaseHTTPRequestHandler):
|
|||||||
if self.server.auth_code:
|
if self.server.auth_code:
|
||||||
status = "successful"
|
status = "successful"
|
||||||
elif self.server.error:
|
elif self.server.error:
|
||||||
status = f"failed ({self.server.error})"
|
status = f"failed ({html.escape(str(self.server.error))})"
|
||||||
else:
|
else:
|
||||||
self._write("<html><body><h1>Invalid request</h1></body></html>")
|
self._write("<html><body><h1>Invalid request</h1></body></html>")
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user