Skip to content

Commit

Permalink
resolved #13 by changing default values for options to promote secure…
Browse files Browse the repository at this point in the history
… connections
  • Loading branch information
neocotic committed Mar 24, 2017
1 parent faf6edf commit d411efd
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 97 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,23 +127,23 @@ yourls.connect('https://example.com/yourls-api.php', {
As you may have noticed; this method also accepts the following entirely optional `options`:

Option | Description | Default
------ | ----------------------------------- | ---------
format | Format in which requests are sent | `"jsonp"`
method | HTTP method to be used for requests | `"GET"`
------ | ----------------------------------- | -----------------------------------------------
format | Format in which requests are sent | `"json"`
method | HTTP method to be used for requests | `"POST"` for `"json"` and `"GET"` for `"jsonp"`

``` javascript
// Does the same as specifying no options (i.e. using defaults)
// This is the best practice if you want to secure the data you're transmitting and you've setup CORS, if needed
yourls.connect('https://example.com/yourls-api.php', null, {
format: 'jsonp',
method: 'GET'
format: 'json',
method: 'POST'
})

// Best practice if you want to secure the data you're transmitting and you've setup CORS, if needed
// However, if you don't want to setup CORS (or can't), you can try using JSONP
yourls.connect('https://example.com/yourls-api.php', {
signature: '3002a61584'
}, {
format: 'json',
method: 'POST'
format: 'jsonp'
})
```

Expand Down
126 changes: 59 additions & 67 deletions dist/yourls.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/yourls.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/yourls.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/yourls.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit d411efd

Please sign in to comment.