Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hi! I cleaned up your code for you! #30

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resty
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ function resty() {
h2t=$((exec 2>&-; (which lynx >/dev/null && echo lynx -stdin -dump) \
|| which html2text || which cat) |tail -n 1)
editor=$((exec 2>&-; which "$EDITOR" || which vim || echo "vi") |tail -n 1)

[ "${method#P}" != "$method" ] || [ "$method" = "TRACE" ] && wantdata="yes"

[ -d "$cookies" ] || (mkdir -p "$cookies"; echo "http://localhost*" > "$host")
[ -n "$1" ] && [ "${1#/}" != "$1" ] \
&& _path="$1" && [[ $# > 0 ]] && shift
[ "$1" = "${1#-}" ] && dat="$1" && [[ $# > 0 ]] && shift

j=1
for i in "$@"; do
[ -n "$maybe_query" -a -z "$query" ] && query="?$i" && continue
Expand Down
2 changes: 1 addition & 1 deletion test/lilhttpd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ done

[ -n "$n" ] && r=$(printf "%s\\n%s" "$r" "$(head -c $n)")

if [ "$reflect" = "yes" ]; then
if [ "$reflect" = "yes" ]; then
ct="text/plain"
else
r=$(cat "$f")
Expand Down
36 changes: 18 additions & 18 deletions test/simple.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jQuery Tablesort Demo</title>
</head>
<body>
<div class="container">
<div>
<div class="nav">
<a href="http://github.com/micha/resty">fork me on github</a>
</div>
<h2>Resty<br />Test<br />Page</h2>
</div>
<hr/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jQuery Tablesort Demo</title>
</head>
<body>
<div class="container">
<div>
<div class="nav">
<a href="http://github.com/micha/resty">fork me on github</a>
</div>
<h2>Resty<br />Test<br />Page</h2>
</div>
<hr/>
<div class="container">
<h3>Hello There.</h3>
<table class="demo jquery-tablesort" cellspacing="0" cellpadding="0">
Expand Down Expand Up @@ -75,7 +75,7 @@ <h3>Hello There.</h3>
column headings to sort and re-sort that column. The rain in
Spain falls mainly on the plain. Thanks!</p>
</div>
<hr />
</div>
</body>
<hr />
</div>
</body>
</html>
40 changes: 20 additions & 20 deletions test/tests.out
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Accept: */*
< Server: lilhttpd/1.0
< Connection: close
< Content-Length: 164
<
<
{ [data not shown]
* Closing connection #0
GET /simple.html HTTP/1.1
Expand Down Expand Up @@ -282,21 +282,21 @@ Server: lilhttpd/1.0
Connection: close
Content-Length: 2340
# [OUT] TEST 7: Raw response
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jQuery Tablesort Demo</title>
</head>
<body>
<div class="container">
<div>
<div class="nav">
<a href="http://github.com/micha/resty">fork me on github</a>
</div>
<h2>Resty<br />Test<br />Page</h2>
</div>
<hr/>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>jQuery Tablesort Demo</title>
</head>
<body>
<div class="container">
<div>
<div class="nav">
<a href="http://github.com/micha/resty">fork me on github</a>
</div>
<h2>Resty<br />Test<br />Page</h2>
</div>
<hr/>
<div class="container">
<h3>Hello There.</h3>
<table class="demo jquery-tablesort" cellspacing="0" cellpadding="0">
Expand Down Expand Up @@ -359,9 +359,9 @@ Content-Length: 2340
column headings to sort and re-sort that column. The rain in
Spain falls mainly on the plain. Thanks!</p>
</div>
<hr />
</div>
</body>
<hr />
</div>
</body>
</html>
# [OUT] TEST 8: Get headers too
* <url> malformed
Expand All @@ -381,7 +381,7 @@ Content-Length: 2340
< Server: lilhttpd/1.0
< Connection: close
< Content-Length: 2340
<
<
{ [data not shown]
* Closing connection #0
[1]fork me on github
Expand Down