Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fd98bff

Browse filesBrowse files
committed
add code to test access to GET arguments
1 parent fc6f20f commit fd98bff
Copy full SHA for fd98bff

File tree

1 file changed

+9
-2
lines changed
Filter options

1 file changed

+9
-2
lines changed

‎examples/webserver/myserver.m

Copy file name to clipboardExpand all lines: examples/webserver/myserver.m
+9-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@ function myserver() % called from C
22

33
switch (webserver.url())
44
case '/'
5-
stllog('hello from /')
5+
stllog('in /')
66
webserver.html('home here');
77
case '/bob'
88
%webserver.template('templates/home.html', values);
9-
stllog('bob');
9+
stllog('in /bob');
10+
a = webserver.getarg('a');
11+
if ~isempty(a)
12+
stllog('a = %s', cstring(a));
13+
end
1014
webserver.html('<html><body>hello <b>from</b> /bob</body></html>');
1115
case '/alice'
16+
stllog('in /alice')
1217
vals.a = 1;
1318
vals.b = 2;
1419
webserver.template('templates/alice.html', vals);
20+
case '/duck'
21+
webserver.file('duck.jpg', 'image/jpeg');
1522
end

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.