iodine 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of iodine might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b38604622998dd86c23390d22f206cd77e235437
4
- data.tar.gz: d82068cbc80b9ccd7aa0838efbc50e9fdfadc1f1
3
+ metadata.gz: 9f2f657fb4dfe53dba0db85aa2b84685287e0d1e
4
+ data.tar.gz: '04085f50a4e1dcb50f960ea32a62717aed58b77c'
5
5
  SHA512:
6
- metadata.gz: 15be0353bd34deb982497787ff2c79bff9a504410a364ba46a4fa23aebf66e1d28441b2cf6103773b02cedcb598a7c2e091d533eaff5b5acc6ce41cdfea7b695
7
- data.tar.gz: 96652525a23cbd5fa0e88c69cd490502f857bb609fc3b40db073b1ccac3da3f25879213385a5d732df0b89a09c038c46f531034834cb6b1491c5ae4ac3340e3d
6
+ metadata.gz: e464440c9fdaf6dba8ca6ae60e7d29d7d90cd6a3a31557573b558296ded54b83d373542777697e0b41cdde863d6131b73bbd8a9da9ca7d9f1b8a6a738ff66dc8
7
+ data.tar.gz: a2a1e275c0754427e4f6efce6e1111976d9fb87a1c4710dd2be5d46627f3ee6476de8b7fa82e134a039ce50454bd981ba36aa96bd76dc69a9d8ba36852648af1
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ Please notice that this change log contains changes for upcoming releases as wel
6
6
 
7
7
  ## Changes:
8
8
 
9
+ #### Change log v.0.4.5
10
+
11
+ **Fix**: fix static file service for `X-Sendfile` as well as static error file fallback pages (404.html etc').
12
+
9
13
  ***
10
14
 
11
15
  #### Change log v.0.4.4
@@ -234,10 +234,11 @@ int http_response_sendfile2(http_response_s *response, http_request_s *request,
234
234
  if (file_path_safe && path_safe_len == 0)
235
235
  path_safe_len = strlen(file_path_safe);
236
236
 
237
- if (file_path_unsafe && path_unsafe_len == 0)
237
+ if (file_path_unsafe && path_unsafe_len == 0) {
238
238
  path_unsafe_len = strlen(file_path_unsafe);
239
- if (!path_unsafe_len)
240
- return -1;
239
+ if (!path_unsafe_len)
240
+ return -1;
241
+ }
241
242
 
242
243
  const char *mime = NULL;
243
244
  const char *ext = NULL;
@@ -257,6 +258,8 @@ int http_response_sendfile2(http_response_s *response, http_request_s *request,
257
258
  if (file_path_unsafe) {
258
259
  if (fname[path_safe_len - 1] == '/' && file_path_unsafe[0] == '/')
259
260
  path_safe_len--;
261
+ else if (fname[path_safe_len - 1] != '/' && file_path_unsafe[0] != '/')
262
+ fname[path_safe_len++] = '/';
260
263
  ssize_t tmp = http_decode_path(fname + path_safe_len, file_path_unsafe,
261
264
  path_unsafe_len);
262
265
  if (tmp < 0)
@@ -412,7 +412,8 @@ static void *on_rack_request_in_GVL(http_request_s *request) {
412
412
  // X-Sendfile support only present when iodine sercers static files.
413
413
  VALUE xfiles;
414
414
  if (request->settings->public_folder &&
415
- (xfiles = rb_hash_aref(response_headers, XSENDFILE)) != Qnil) {
415
+ (xfiles = rb_hash_aref(response_headers, XSENDFILE)) != Qnil &&
416
+ TYPE(xfiles) == T_STRING) {
416
417
  int fr = 0;
417
418
  if (OBJ_FROZEN(response_headers)) {
418
419
  response_headers = rb_hash_dup(response_headers);
@@ -1,3 +1,3 @@
1
1
  module Iodine
2
- VERSION = '0.4.4'.freeze
2
+ VERSION = '0.4.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iodine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boaz Segev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-26 00:00:00.000000000 Z
11
+ date: 2017-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack