facebook / facebook/hhvm

The admin interface handles FCGI requests incorrectly

Aberta
#3,379 1 comentário 0 reações 0 responsáveis Ver no GitHub
documentation webserver
Linguagem predominante
C++
Estrelas
18.7k
Forks
3.1k
Merge médio
1h 47min
PRs com merge (30d)
2

Descrição

While working on setting up a monitoring-management virtual host for the admin interface, I discovered that the HHVM admin interface just considers the original url of the HTTP request in order to build a response, and not the FastCGI variables like SCRIPT_NAME et cetera.

This makes practically impossible to serve the admin interface under a mountpoint: if I do like follows (for example, using apache):

```
ProxyPassMatch ^/hhvm-admin/(.*)$ fcgi://localhost:9500/$1
```

and then try to see the help page:

```
curl http://localhost/hhvm-admin/
```

I get inexpectedly a 404 with a message "Unknown command: hhvm-admin/"

I traced this to method `AdminRequestHandler::handleRequest` in `hphp/runtime/server/admin-request-handler.cpp`: at line 122 I see that the `cmd` variable that will later be used as the command to execute gets assigned as follows

```
std::string cmd = transport->getCommand();
```

and the `transport->getCommand` method ends up calling `URL::getCommand()` which will (I guess, I had no time/ability to investigate further) operate on the HTTP_URL and not on the appropriate FastCGI variables, thus making any attempt at serving the admin interface in any way but with a dedicated VirtualHost vane.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.