Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Add /extensions endpoint #33

Merged
merged 1 commit into from
Sep 26, 2016
Merged

Add /extensions endpoint #33

merged 1 commit into from
Sep 26, 2016

Conversation

bbondy
Copy link
Member

@bbondy bbondy commented Sep 20, 2016

Still a WIP while I get this integrated in desktop, it might need more changes. Just throwing it up for now though.

@bbondy bbondy force-pushed the extensions branch 3 times, most recently from 7173202 to 8838740 Compare September 26, 2016 03:43
@bbondy bbondy changed the title Add /extensions endpoint WIP Add /extensions endpoint Sep 26, 2016
@bbondy
Copy link
Member Author

bbondy commented Sep 26, 2016

@aekeus this is ready for review, pls also deploy if you are ok with the changes.


const setup = (runtime, availableExtensions) => {
let extensionsRoute = {
method: ['POST'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a POST here a requirement of the extensions support? Generally a POST will mutate the state of the server.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes chrome uses POST so it's just implementing what they use.

handler: function (request, reply) {
const requestedExtensions = getRequestedExtensions(request.payload.toString())
const extensionsWithUpdates = getExtensionsWithUpdates(availableExtensions, requestedExtensions)
reply(getExtensionsResponse('https://s3.amazonaws.com/brave-extensions/release', extensionsWithUpdates))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can we move this to an environment variable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do env and default to that if not defined, good suggestion thx.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants