Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
66478b73
Unverified
Commit
66478b73
authored
Jan 12, 2020
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
Fix #40
parent
4e4a1386
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/main/java/org/b3log/solo/processor/BeforeRequestHandler.java
...n/java/org/b3log/solo/processor/BeforeRequestHandler.java
+3
-1
src/main/java/org/b3log/solo/processor/PermalinkHandler.java
src/main/java/org/b3log/solo/processor/PermalinkHandler.java
+1
-2
No files found.
src/main/java/org/b3log/solo/processor/BeforeRequestHandler.java
View file @
66478b73
...
...
@@ -17,6 +17,7 @@
*/
package
org
.
b3log
.
solo
.
processor
;
import
org.b3log.latke.Keys
;
import
org.b3log.latke.http.RequestContext
;
import
org.b3log.latke.http.handler.Handler
;
import
org.b3log.latke.util.Requests
;
...
...
@@ -27,13 +28,14 @@ import org.b3log.solo.util.Solos;
* Before request handler.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
1
, Jan 12, 2020
* @version 1.0.0.
2
, Jan 12, 2020
* @since 3.6.7
*/
public
class
BeforeRequestHandler
implements
Handler
{
@Override
public
void
handle
(
final
RequestContext
context
)
{
context
.
attr
(
Keys
.
HttpRequest
.
START_TIME_MILLIS
,
System
.
currentTimeMillis
());
final
String
remoteAddr
=
Requests
.
getRemoteAddr
(
context
.
getRequest
());
if
(
Solos
.
BLACKLIST_IPS
.
contains
(
remoteAddr
))
{
context
.
setStatus
(
429
);
...
...
src/main/java/org/b3log/solo/processor/PermalinkHandler.java
View file @
66478b73
...
...
@@ -40,7 +40,7 @@ import org.json.JSONObject;
* Article permalink handler.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
3, Nov 3, 2019
* @version 1.0.0.
4, Jan 12, 2020
* @since 3.2.0
*/
public
class
PermalinkHandler
implements
Handler
{
...
...
@@ -124,7 +124,6 @@ public class PermalinkHandler implements Handler {
*
* @param context the specified request context
* @param article the specified article
* @see Dispatcher#rendTODO(RequestContext)
*/
private
void
dispatchToArticleProcessor
(
final
RequestContext
context
,
final
JSONObject
article
)
{
context
.
attr
(
Article
.
ARTICLE
,
article
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment