-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2495 from blockscout/release/v1-37-2
Release v1.37.2
- Loading branch information
Showing
19 changed files
with
135 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export const ABSENT_PARAM_ERROR_MESSAGE = 'Required param not provided'; | ||
|
||
export default function throwOnAbsentParamError(param: unknown) { | ||
if (!param) { | ||
throw new Error('Required param not provided', { cause: { status: 404 } }); | ||
throw new Error(ABSENT_PARAM_ERROR_MESSAGE, { cause: { status: 404 } }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import type { Dictionary } from 'rollbar'; | ||
|
||
export function isBot(userAgent: string | undefined) { | ||
if (!userAgent) return false; | ||
|
||
const botPatterns = [ | ||
'Googlebot', // Google | ||
'Baiduspider', // Baidu | ||
'bingbot', // Bing | ||
'YandexBot', // Yandex | ||
'DuckDuckBot', // DuckDuckGo | ||
'Slurp', // Yahoo | ||
'Applebot', // Apple | ||
'facebookexternalhit', // Facebook | ||
'Twitterbot', // Twitter | ||
'rogerbot', // Moz | ||
'Alexa', // Alexa | ||
'AhrefsBot', // Ahrefs | ||
'SemrushBot', // Semrush | ||
'spider', // Generic spiders | ||
'crawler', // Generic crawlers | ||
]; | ||
|
||
return botPatterns.some(pattern => | ||
userAgent.toLowerCase().includes(pattern.toLowerCase()), | ||
); | ||
} | ||
|
||
export function isHeadlessBrowser(userAgent: string | undefined) { | ||
if (!userAgent) return false; | ||
|
||
if ( | ||
userAgent.includes('headless') || | ||
userAgent.includes('phantomjs') || | ||
userAgent.includes('selenium') || | ||
userAgent.includes('puppeteer') | ||
) { | ||
return true; | ||
} | ||
} | ||
|
||
export function isNextJsChunkError(url: unknown) { | ||
if (typeof url !== 'string') return false; | ||
return url.includes('/_next/'); | ||
} | ||
|
||
export function getRequestInfo(item: Dictionary): { url: string } | undefined { | ||
if ( | ||
!item.request || | ||
item.request === null || | ||
typeof item.request !== 'object' || | ||
!('url' in item.request) || | ||
typeof item.request.url !== 'string' | ||
) { | ||
return undefined; | ||
} | ||
return { url: item.request.url }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-1.52 KB
(91%)
ui/shared/AppError/__screenshots__/AppError.pw.tsx_default_status-code-403-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1.4 KB
(96%)
...zontal/__screenshots__/NavigationDesktop.pw.tsx_default_with-groped-items-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-931 Bytes
(93%)
..._screenshots__/NavigationDesktop.pw.tsx_dark-color-mode_no-auth-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-1003 Bytes
(92%)
...rtical/__screenshots__/NavigationDesktop.pw.tsx_default_no-auth-dark-mode-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters