Skip to content

Commit

Permalink
Fix options_asterisk_methods test and conf parsing
Browse files Browse the repository at this point in the history
* Remove unused yaws.conf options_asterisk_methods parse clause.

* Assert no allow header and assert server and date headers in
  400 response for OPTIONS *.
  • Loading branch information
avtobiff authored and vinoski committed Mar 23, 2021
1 parent cd59364 commit 7affcb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/yaws_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,6 @@ fload(FD, options_asterisk_methods, GC, C, Lno, Chars) ->
[Methods] ->
C1 = C#sconf{options_asterisk_methods = Methods},
fload(FD, options_asterisk_methods, GC, C1, Lno+1, ?NEXTLINE);
['<', "/options_asterisk_methods", '>'] ->
fload(FD, server, GC, C, Lno+1, ?NEXTLINE);
[H|T] ->
{error, ?F("Unexpected input ~p at line ~w", [[H|T], Lno])};
Err ->
Expand Down
4 changes: 4 additions & 0 deletions testsuite/main_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ options_asterisk_methods(Config) ->
[{"Host", "127.0.0.1:"++integer_to_list(Port2)}]
)),
{ok, {{_,400,_}, Hdrs2, _}} = testsuite:receive_http_response(Sock2),
?assert(not proplists:is_defined("allow", Hdrs2)),
?assert(proplists:is_defined("server", Hdrs2)),
?assert(proplists:is_defined("date", Hdrs2)),
?assertEqual(ok, gen_tcp:close(Sock2)),

ok.

http_head(Config) ->
Expand Down

0 comments on commit 7affcb8

Please sign in to comment.