mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-13 00:45:25 +02:00
fix
This commit is contained in:
parent
9400d52ee9
commit
abf95a76db
@ -111,12 +111,12 @@ function extractPath(url) {
|
|||||||
const path = urlObj.pathname;
|
const path = urlObj.pathname;
|
||||||
|
|
||||||
// Define a regular expression to match "/{param1}/{param2}/src/{branch}/{main}/"
|
// Define a regular expression to match "/{param1}/{param2}/src/{branch}/{main}/"
|
||||||
const regex = /^\/[^\/]+\/[^\/]+\/src\/[^\/]+\/[^\/]+\//;
|
const regex = /^\/[^/]+\/[^/]+\/src\/[^/]+\/[^/]+\//;
|
||||||
|
|
||||||
// Use RegExp#exec() method to match the path
|
// Use RegExp#exec() method to match the path
|
||||||
const match = regex.exec(path);
|
const match = regex.exec(path);
|
||||||
if (match) {
|
if (match) {
|
||||||
return path.substring(match[0].length);
|
return path.substring(match[0].length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the path does not match, return the original path
|
// If the path does not match, return the original path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user