emartech / escher-php

Library for HTTP request signing (PHP implementation)
MIT License
17 stars 12 forks source link

presignUrl() request generates Notice if host is non-ssl #7

Closed weplan9 closed 8 years ago

weplan9 commented 8 years ago

On line 381 $scheme = $this->serverVars["HTTPS"] === "on" ? 'https' : 'http';

This will raise a notice if server call is non https.

To fix I have done following, Maybe I am wrong. I am not a programmer sorry.

if (array_key_exists('HTTPS', $_SERVER) && $_SERVER["HTTPS"] == "on"){ $scheme = 'https'; }else{ $scheme = 'http'; }