Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WebServer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
diufeYmike
WebServer
Commits
8c05e9c3
Commit
8c05e9c3
authored
2 years ago
by
codecraft
Browse files
Options
Downloads
Patches
Plain Diff
rename `get_form_keys` to `get_get_form_keys`
parent
21a170df
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/http/src/handling/request.rs
+7
-1
7 additions, 1 deletion
core/http/src/handling/request.rs
site/src/main.rs
+1
-1
1 addition, 1 deletion
site/src/main.rs
with
8 additions
and
2 deletions
core/http/src/handling/request.rs
+
7
−
1
View file @
8c05e9c3
...
@@ -2,7 +2,10 @@
...
@@ -2,7 +2,10 @@
use
std
::{
collections
::
HashMap
,
error
::
Error
,
fmt
::
Display
};
use
std
::{
collections
::
HashMap
,
error
::
Error
,
fmt
::
Display
};
use
mime
::
Mime
;
use
super
::{
use
super
::{
file_handlers
::
find_mimetype
,
methods
::
Method
,
methods
::
Method
,
routes
::{
Data
,
Uri
},
routes
::{
Data
,
Uri
},
};
};
...
@@ -63,7 +66,10 @@ impl Request<'_> {
...
@@ -63,7 +66,10 @@ impl Request<'_> {
_
=>
false
,
_
=>
false
,
}
}
}
}
pub
fn
get_form_keys
(
&
self
,
keys
:
Vec
<&
str
>
)
->
Result
<
HashMap
<&
str
,
&
str
>
,
ParseFormError
>
{
pub
fn
get_get_form_keys
(
&
self
,
keys
:
Vec
<&
str
>
,
)
->
Result
<
HashMap
<&
str
,
&
str
>
,
ParseFormError
>
{
let
data
=
if
let
Some
(
val
)
=
self
.uri
.split_once
(
"?"
)
{
let
data
=
if
let
Some
(
val
)
=
self
.uri
.split_once
(
"?"
)
{
val
val
}
else
{
}
else
{
...
...
This diff is collapsed.
Click to expand it.
site/src/main.rs
+
1
−
1
View file @
8c05e9c3
...
@@ -21,7 +21,7 @@ fn hashmap_to_string(map: &HashMap<&str, &str>) -> String {
...
@@ -21,7 +21,7 @@ fn hashmap_to_string(map: &HashMap<&str, &str>) -> String {
}
}
fn
handle_static_hi
(
request
:
Request
<
'_
>
,
data
:
Data
)
->
Outcome
<
Response
,
Status
,
Data
>
{
fn
handle_static_hi
(
request
:
Request
<
'_
>
,
data
:
Data
)
->
Outcome
<
Response
,
Status
,
Data
>
{
let
keys
=
if
let
Ok
(
keys
)
=
request
.get_form_keys
(
vec!
[
"asdf"
,
"jkl;"
])
{
let
keys
=
if
let
Ok
(
keys
)
=
request
.get_
get_
form_keys
(
vec!
[
"asdf"
,
"jkl;"
])
{
keys
keys
}
else
{
}
else
{
return
Outcome
::
Forward
(
data
);
return
Outcome
::
Forward
(
data
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment