Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf10c2e0

Browse files
fix(buildFullPath): handleallowAbsoluteUrls: false withoutbaseURL (#6833)
Co-authored-by: Jay <jasonsaayman@gmail.com>
1 parent1e6632c commitf10c2e0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

‎lib/core/buildFullPath.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import combineURLs from '../helpers/combineURLs.js';
1515
*/
1616
exportdefaultfunctionbuildFullPath(baseURL,requestedURL,allowAbsoluteUrls){
1717
letisRelativeUrl=!isAbsoluteURL(requestedURL);
18-
if(baseURL&&isRelativeUrl||allowAbsoluteUrls==false){
18+
if(baseURL&&(isRelativeUrl||allowAbsoluteUrls==false)){
1919
returncombineURLs(baseURL,requestedURL);
2020
}
2121
returnrequestedURL;

‎test/specs/core/buildFullPath.spec.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ describe('helpers::buildFullPath', function () {
1313
expect(buildFullPath('https://api.github.com','https://api.example.com/users',false)).toBe('https://api.github.com/https://api.example.com/users');
1414
});
1515

16+
it('should not combine the URLs when the requestedURL is absolute, allowAbsoluteUrls is false, and the baseURL is not configured',function(){
17+
expect(buildFullPath(undefined,'https://api.example.com/users',false)).toBe('https://api.example.com/users');
18+
});
19+
1620
it('should not combine URLs when the baseURL is not configured',function(){
1721
expect(buildFullPath(undefined,'/users')).toBe('/users');
1822
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp