mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-22 11:35:43 -04:00
Use S_ISDIR to determine file directoryishness
This commit is contained in:
parent
e991d1ec08
commit
a6b9099e01
@ -343,7 +343,7 @@ void config_handler(WS_CONNINFO *pwsc) {
|
|||||||
|
|
||||||
/* this is quite broken, but will work */
|
/* this is quite broken, but will work */
|
||||||
os_stat(resolved_path,&sb);
|
os_stat(resolved_path,&sb);
|
||||||
if(sb.st_mode & S_IFDIR) {
|
if(S_ISDIR(sb.st_mode)) {
|
||||||
ws_addresponseheader(pwsc,"Location","/index.html");
|
ws_addresponseheader(pwsc,"Location","/index.html");
|
||||||
ws_returnerror(pwsc,302,"Moved");
|
ws_returnerror(pwsc,302,"Moved");
|
||||||
config_set_status(pwsc,0,NULL);
|
config_set_status(pwsc,0,NULL);
|
||||||
|
@ -107,7 +107,7 @@ void upnp_build_packet(char *packet, int len, UPNP_PACKETINFO *pi) {
|
|||||||
|
|
||||||
port = conf_get_int("general","port",0);
|
port = conf_get_int("general","port",0);
|
||||||
|
|
||||||
len = upnp_strcat("NOTIFY * HTTP/1.0\r\n",packet,len);
|
len = upnp_strcat("NOTIFY * HTTP/1.1\r\n",packet,len);
|
||||||
if(pi->location) {
|
if(pi->location) {
|
||||||
gethostname(hostname,sizeof(hostname));
|
gethostname(hostname,sizeof(hostname));
|
||||||
snprintf(buffer,sizeof(buffer),"LOCATION: http://%s:%d%s\r\n",
|
snprintf(buffer,sizeof(buffer),"LOCATION: http://%s:%d%s\r\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user