Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

switch to https urls in the DS_NPR_API class #44

Merged
merged 8 commits into from
Apr 16, 2018
Merged

Conversation

benlk
Copy link
Contributor

@benlk benlk commented Jan 22, 2018

Changes

(edited)

  • Replaces all http: URLs in the plugin with https: URLs
  • Updates the regular expressions used by DS_NPR_API::load_page_hook to find the story ID
  • Updates the NPRML XML namespace declaration to also use an HTTPS URL: NPRML XML namespace link does not return a schema #45
  • Replaces a few outdated NPR links in docs and readmes with correct ones, where the redirect worked in an obvious fashion:
    • Account signup pages
    • Ari Shapiro's bio

Why

From the update document:

With NPR.org going HTTPS, following update needs to be made in the Story API plugin for querying Story content so NPR stories can be queried by HTTPS and HTTP URLs

For INN#11

@benlk
Copy link
Contributor Author

benlk commented Jan 22, 2018

A question before merging: do any of these other references to insecure URLs need to be changed?

./classes/NPRAPI.php:  const NPRAPI_PULL_URL = 'http://api.npr.org';
./classes/NPRAPI.php:  const NPRML_NAMESPACE = 'xmlns:nprml=http://api.npr.org/nprml';
./classes/NPRAPIWordpress.php:   *   The path part of the request URL (i.e., http://example.com/PATH).
./ds-npr-api.php:	$def_url = 'http://api.npr.org';
./get_stories.php:					if ( stristr( $query_string, 'http:' ) ) {
./settings_ui.php:       <div><p>Create an NPR API query (see the <a target="_" href="http://www.npr.org/api/queryGenerator.php">NPR API query generator</a>). Enter your queries into one of the rows below to have stories on that query automatically publish to your site. Please note, you do not need to include your API key to the query.  </div>
./tests/test-ds-npr-api.php:		$this->assertEquals( $option, 'http://api.npr.org' );

@benlk
Copy link
Contributor Author

benlk commented Mar 19, 2018

@milespj
Copy link
Contributor

milespj commented Mar 19, 2018

Hi Ben -

All of NPR's website links (including API calls) are generally now HTTPS. In fact if you find any that aren't HTTPS let me know! So, we should update all of the URL's to be HTTPS to eliminate unnecessary redirects.

@benlk
Copy link
Contributor Author

benlk commented Mar 20, 2018

Cool, I'll update this pull request with https urls for all the NPR links, where those links can be updated.

Of note:

Also, replace some broken links where the correct link is obvious. Don't replace broken links where the broken link isn't obvious. See npr#44 (comment)
@milespj
Copy link
Contributor

milespj commented Mar 21, 2018

Thanks for all of these documentation edits! Other than the one URL that was still marked as HTTP this looks good.

@benlk
Copy link
Contributor Author

benlk commented Mar 23, 2018

That must've happened when I merged f4032ce into this branch; my bad. It's fixed now.

@milespj
Copy link
Contributor

milespj commented Apr 13, 2018

Just wanted to mention that I'm good with this pull request!

@benlk benlk merged commit 9d3b111 into npr:master Apr 16, 2018
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