knutin / elli

Simple, robust and performant Erlang web server
MIT License
663 stars 79 forks source link

URL Hash not included in Request Data Structure #92

Closed craig552uk closed 9 years ago

craig552uk commented 9 years ago

The URL hash fragment is not included in the request structure.

e.g.

curl localhost:3000/hello?a=b#c

When displaying the Request using elli_request:to_proplist(Req) on the request_complete event handler:

[{method,'GET'},
      {path,[<<"hello">>]},
      {args,[{<<"a">>,<<"b">>}]},
      {raw_path,<<"/hello?a=b">>},
      {version,{1,1}},
      {headers,[{<<"Accept">>,<<"*/*">>},
                {<<"Host">>,<<"localhost:3000">>},
                {<<"User-Agent">>,<<"curl/7.38.0">>}]},
      {body,<<>>},
      {pid,<0.37.0>},
      {socket,{plain,#Port<0.824>}},
      {callback,{elli_hello_http,undefined}}
dantodor commented 9 years ago

I think this is the intended way all the modern browsers work, due to libraries like Angular or Ember use the hash in the address bar for defining internal routes.

knutin commented 9 years ago

Yes, @dantodor is right. The browsers don't actually send the fragment: https://en.wikipedia.org/wiki/Fragment_identifier

craig552uk commented 9 years ago

That, I did not know. Thank you both and apologies for the unnecessary ticket.