Skip to content

Commit

Permalink
Ensure Node server is localhost only
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Dec 4, 2021
1 parent f527159 commit 2879883
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- ...

## 1.1.0 - 2021-12-03

- Switch to processing SSR through Node sidecar server and various other performance & caching enhancements

## 1.0.0 - 2021-09-25

- First release (currently experimental stage).
2 changes: 1 addition & 1 deletion lib/bridgetown-lit-renderer/renderer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def render(code, data:, entry:, caching: true) # rubocop:todo Metrics/MethodLeng
self.class.start_node_server

output = Faraday.post(
"http://localhost:#{self.class.serverport}",
"http://127.0.0.1:#{self.class.serverport}",
"const data = #{data.to_json}; #{built_code}",
"Authorization" => "Bearer #{self.class.authtoken}"
).body
Expand Down
4 changes: 2 additions & 2 deletions src/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ const server = http.createServer((req, res) => {
}
})

const port = process.env.LIT_SSR_SERVER_PORT || 5500
server.listen(port);
const port = process.env.LIT_SSR_SERVER_PORT
server.listen(port, "127.0.0.1")

0 comments on commit 2879883

Please sign in to comment.