Skip to content

Commit

Permalink
[elm-package] Fix elm package service (#1986)
Browse files Browse the repository at this point in the history
  • Loading branch information
Y0hy0h authored and paulmelnikow committed Aug 28, 2018
1 parent 64d325b commit edea36d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions services/elm-package/elm-package.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module.exports = class ElmPackage extends LegacyService {
camp.route(
/^\/elm-package\/v\/([^/]+)\/([^/]+)\.(svg|png|gif|jpg|json)$/,
cache((data, match, sendBadge, request) => {
const urlPrefix = 'http://package.elm-lang.org/packages'
const urlPrefix = 'https://package.elm-lang.org/packages'
const [, user, repo, format] = match
const apiUrl = `${urlPrefix}/${user}/${repo}/latest/elm-package.json`
const badgeData = getBadgeData('elm-package', data)
const apiUrl = `${urlPrefix}/${user}/${repo}/latest/elm.json`
const badgeData = getBadgeData('elm package', data)
request(apiUrl, (err, res, buffer) => {
if (err != null) {
badgeData.text[1] = 'inaccessible'
Expand Down
4 changes: 2 additions & 2 deletions services/elm-package/elm-package.tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = t

t.create('gets the package version of elm-lang/core')
.get('/v/elm-lang/core.json')
.expectJSONTypes(Joi.object().keys({ name: 'elm-package', value: isSemver }))
.expectJSONTypes(Joi.object().keys({ name: 'elm package', value: isSemver }))

t.create('invalid package name')
.get('/v/elm-community/frodo-is-not-a-package.json')
.expectJSON({ name: 'elm-package', value: 'invalid' })
.expectJSON({ name: 'elm package', value: 'invalid' })

0 comments on commit edea36d

Please sign in to comment.