mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
fix(web): fix sidebar tarball protocol (#1326)
fix: #1320 https://github.com/verdaccio/verdaccio/issues/1320
This commit is contained in:
parent
2e71daacfd
commit
de0446376d
1 changed files with 3 additions and 3 deletions
|
@ -2,9 +2,8 @@
|
||||||
* @prettier
|
* @prettier
|
||||||
* @flow
|
* @flow
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { addScope, addGravatarSupport, deleteProperties, sortByName, parseReadme, formatAuthor } from '../../../lib/utils';
|
import { addScope, addGravatarSupport, deleteProperties, sortByName, parseReadme, formatAuthor, convertDistRemoteToLocalTarballUrls } from '../../../lib/utils';
|
||||||
import { allow } from '../../middleware';
|
import { allow } from '../../middleware';
|
||||||
import { DIST_TAGS, HEADER_TYPE, HEADERS, HTTP_STATUS } from '../../../lib/constants';
|
import { DIST_TAGS, HEADER_TYPE, HEADERS, HTTP_STATUS } from '../../../lib/constants';
|
||||||
import { generateGravatarUrl } from '../../../utils/user';
|
import { generateGravatarUrl } from '../../../utils/user';
|
||||||
|
@ -102,7 +101,8 @@ function addPackageWebApi(route: Router, storage: IStorageHandler, auth: IAuth,
|
||||||
callback: function(err: Error, info: $SidebarPackage) {
|
callback: function(err: Error, info: $SidebarPackage) {
|
||||||
if (_.isNil(err)) {
|
if (_.isNil(err)) {
|
||||||
let sideBarInfo: any = _.clone(info);
|
let sideBarInfo: any = _.clone(info);
|
||||||
sideBarInfo.latest = info.versions[info[DIST_TAGS].latest];
|
sideBarInfo.versions = convertDistRemoteToLocalTarballUrls(info, req, config.url_prefix).versions;
|
||||||
|
sideBarInfo.latest = sideBarInfo.versions[info[DIST_TAGS].latest];
|
||||||
sideBarInfo.latest.author = formatAuthor(sideBarInfo.latest.author);
|
sideBarInfo.latest.author = formatAuthor(sideBarInfo.latest.author);
|
||||||
sideBarInfo = deleteProperties(['readme', '_attachments', '_rev', 'name'], sideBarInfo);
|
sideBarInfo = deleteProperties(['readme', '_attachments', '_rev', 'name'], sideBarInfo);
|
||||||
if (config.web) {
|
if (config.web) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue