mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 23:41:18 +02:00
2024.5.0 (#39)
This commit is contained in:
@@ -7,12 +7,14 @@ export function fallbackRequestName(r: HttpRequest | GrpcRequest | null): string
|
||||
return r.name;
|
||||
}
|
||||
|
||||
const withoutVariables = r.url.replace(/\$\{\[[^\]]+]}/g, '');
|
||||
const withoutVariables = r.url.replace(/\$\{\[\s*([^\]]+)\s*]}/g, '$1');
|
||||
if (withoutVariables.trim() === '') {
|
||||
return r.model === 'http_request' ? 'New HTTP Request' : 'new gRPC Request';
|
||||
}
|
||||
|
||||
const fixedUrl = r.url.match(/^https?:\/\//) ? r.url : 'http://' + r.url;
|
||||
const fixedUrl = withoutVariables.match(/^https?:\/\//)
|
||||
? withoutVariables
|
||||
: 'http://' + withoutVariables;
|
||||
|
||||
if (r.model === 'grpc_request' && r.service != null && r.method != null) {
|
||||
const shortService = r.service.split('.').pop();
|
||||
|
||||
Reference in New Issue
Block a user