Skip to content

Commit

Permalink
refactor: https protocol ternary consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Aug 8, 2022
1 parent 57f7d87 commit 2b2a8fa
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/events/websocket/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export default class HttpServer {
}

log.notice(
`Offline [http for websocket] listening on http${
httpsProtocol ? 's' : ''
`Offline [http for websocket] listening on ${
httpsProtocol ? 'https' : 'http'
}://${host}:${websocketPort}`,
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/events/websocket/WebSocketServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ export default class WebSocketServer {
const { host, httpsProtocol, websocketPort } = this.#options

log.notice(
`Offline [websocket] listening on ws${
httpsProtocol ? 's' : ''
`Offline [websocket] listening on ${
httpsProtocol ? 'wss' : 'ws'
}://${host}:${websocketPort}`,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class WebSocketConnectEvent {
// 'X-Amzn-Trace-Id': `Root=${createUniqueId()}`,
// 'X-Forwarded-For': '127.0.0.1',
// 'X-Forwarded-Port': String(this.#websocketPort),
// 'X-Forwarded-Proto': `http${this.#httpsProtocol ? 's' : ''}`,
// 'X-Forwarded-Proto': ${httpsProtocol ? 'https' : 'http'},
// }

const headers = parseHeaders(this.#rawHeaders)
Expand Down
8 changes: 5 additions & 3 deletions src/lambda/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ export default class HttpServer {
}

log.notice(
`Offline [http for lambda] listening on http${
httpsProtocol ? 's' : ''
`Offline [http for lambda] listening on ${
httpsProtocol ? 'https' : 'http'
}://${host}:${lambdaPort}`,
)

// Print all the invocation routes to debug
const basePath = `http${httpsProtocol ? 's' : ''}://${host}:${lambdaPort}`
const basePath = `${
httpsProtocol ? 'https' : 'http'
}://${host}:${lambdaPort}`
const funcNamePairs = this.#lambda.listFunctionNamePairs()

log.notice(
Expand Down

0 comments on commit 2b2a8fa

Please sign in to comment.