Skip to content

Commit

Permalink
rename handler
Browse files Browse the repository at this point in the history
  • Loading branch information
fforbeck committed Jan 10, 2025
1 parent a088b37 commit 80f37fa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/edge-gateway-link/src/cors.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function addCorsHeaders (request, response) {
* @param {Request} request
* @returns {Response}
*/
export function withPreflightRequest (request) {
export function corsPreflightRequest (request) {
const headers = new Headers()
headers.set('Access-Control-Allow-Origin', request.headers.get('origin') || '*')
headers.set('Access-Control-Allow-Methods', 'GET, HEAD, POST, OPTIONS')
Expand Down
4 changes: 2 additions & 2 deletions packages/edge-gateway-link/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ipnsGet } from './ipns.js'
import { versionGet } from './version.js'
import { gatewayGet } from './gateway.js'

import { addCorsHeaders, withPreflightRequest, withCorsHeaders } from './cors.js'
import { addCorsHeaders, corsPreflightRequest, withCorsHeaders } from './cors.js'
import { errorHandler } from './error-handler.js'
import { envAll } from './env.js'

Expand All @@ -18,7 +18,7 @@ const router = Router()

router
.all('*', envAll)
.options('*', withPreflightRequest)
.options('*', corsPreflightRequest)
.post('*', withCorsHeaders(proxyPostRequest))
.get('/version', withCorsHeaders(versionGet))
.get('/ipfs/:cid', withCorsHeaders(ipfsGet))
Expand Down

0 comments on commit 80f37fa

Please sign in to comment.