Skip to content

Commit 56083fa

Browse files
committed
[sinatra] Add json-tls test
1 parent fd5a28f commit 56083fa

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

frameworks/sinatra/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ RUN bundle install --jobs=$(nproc)
2020

2121
COPY . .
2222

23-
EXPOSE 8080
23+
EXPOSE 8080 8081
2424

2525
CMD ["bundle", "exec", "puma", "-C", "puma.rb"]

frameworks/sinatra/meta.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
"limited-conn",
1313
"json",
1414
"json-comp",
15+
"json-tls",
1516
"upload",
1617
"api-4",
1718
"api-16",
1819
"async-db",
1920
"static"
2021
],
2122
"maintainers": []
22-
}
23+
}

frameworks/sinatra/puma.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
threads ENV.fetch('MAX_THREADS', 4).to_i
22

3-
bind 'tcp://0.0.0.0:8080'
3+
tls_cert_path = ENV.fetch('TLS_CERT', '/certs/server.crt')
4+
tls_key_path = ENV.fetch('TLS_KEY', '/certs/server.key')
5+
bind "tcp://0.0.0.0:8080"
6+
bind "ssl://0.0.0.0:8081?cert=#{tls_cert_path}&key=#{tls_key_path}"
47

58
# Allow all HTTP methods so unknown ones reach Rack middleware (returned as 405)
69
supported_http_methods :any

0 commit comments

Comments
 (0)