Skip to content

Commit

Permalink
api key casing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewplummer committed Jan 28, 2025
1 parent c3e6486 commit 7958165
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion services/web/src/components/RequestBlock/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class RequestBlock extends React.Component {
getDefaultHeaders() {
const { authToken, apiKey, request } = this.props;
const headers = {
'API-Key': `${apiKey || '<apiKey>'}`,
'Api-Key': `${apiKey || '<apiKey>'}`,
...this.props.headers,
};
if (authToken) {
Expand Down
4 changes: 2 additions & 2 deletions services/web/src/docs/pages/GettingStarted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Main production URL:
### API Key

Each client using using the api must provide use an API key to identify itself.
You can provide your API key via an header (`API-Key: <apiKey>`):
You can provide your API key via an header (`Api-Key: <apiKey>`):

<Code language="bash">{`curl -H 'API-Key: <apiKey>' ${API_URL}/`}</Code>
<Code language="bash">{`curl -H 'Api-Key: <apiKey>' ${API_URL}/`}</Code>

### Authentication

Expand Down
3 changes: 1 addition & 2 deletions services/web/src/utils/api/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ function getHeaders(options) {
token ||= getToken();
return {
Accept: 'application/json',
// TODO: casing
'API-Key': API_KEY,
'Api-Key': API_KEY,
...(token && {
Authorization: `Bearer ${token}`,
}),
Expand Down

0 comments on commit 7958165

Please sign in to comment.