Skip to content

Commit

Permalink
Ensure that the provider uses https
Browse files Browse the repository at this point in the history
  • Loading branch information
halosghost committed Jul 16, 2016
1 parent 72c3210 commit 4c4990e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.c
Expand Up @@ -159,6 +159,12 @@ main (signed argc, char * argv []) {
}
}

const char * the_provider = state.provider ? state.provider : def_provider;
if ( !strstr(the_provider, "https://") ) {
fputs("pbpst: only https providers are supported\n", stderr);
exit_status = EXIT_FAILURE; goto cleanup;
}

exit_status = pbpst_dispatch(&state);
if ( exit_status == CURLE_HTTP_RETURNED_ERROR ) { goto cleanup; }

Expand Down

1 comment on commit 4c4990e

@HalosGhost
Copy link
Owner

Choose a reason for hiding this comment

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

Now that we have a use for determining the real provider in main, we should probably just pass this one down and avoid all the times in the future where the callee determines which provider to use. Centralizes some logic and will deduplicate that determination.

Please sign in to comment.