mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Handled bad redirect URLs for private sites
no issue - Sentry flagged up a redirect URL for the POST action of accessing a private site which would throw a 500 - `decodeURIComponent` would throw an error if it was passed bad data - this commit moves the `decodeURIComponent` inside the try-catch to handle the error
This commit is contained in:
parent
c9af8844ba
commit
65d258972b
1 changed files with 1 additions and 2 deletions
|
@ -22,9 +22,8 @@ function verifySessionHash(salt, hash) {
|
|||
}
|
||||
|
||||
function getRedirectUrl(query) {
|
||||
const redirect = decodeURIComponent(query.r || '/');
|
||||
|
||||
try {
|
||||
const redirect = decodeURIComponent(query.r || '/');
|
||||
return url.parse(redirect).pathname;
|
||||
} catch (e) {
|
||||
return '/';
|
||||
|
|
Loading…
Add table
Reference in a new issue