• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

apache / rocketmq-dashboard / 200

pending completion
200

Pull #130

travis-ci-com

web-flow
Merge e87e98135 into 86bdb0636
Pull Request #130: Bump snakeyaml from 1.30 to 1.32

2374 of 2869 relevant lines covered (82.75%)

1.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/org/apache/rocketmq/dashboard/filter/HttpBasicAuthorizedFilter.java
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *     http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17

18
package org.apache.rocketmq.dashboard.filter;
19

20
import java.io.IOException;
21
import javax.servlet.Filter;
22
import javax.servlet.FilterChain;
23
import javax.servlet.FilterConfig;
24
import javax.servlet.ServletException;
25
import javax.servlet.ServletRequest;
26
import javax.servlet.ServletResponse;
27
import javax.servlet.annotation.WebFilter;
28
import javax.servlet.http.HttpServletResponse;
29

30

31
@WebFilter(urlPatterns = "/*", filterName = "httpBasicAuthorizedFilter")
32
public class HttpBasicAuthorizedFilter implements Filter {
×
33
    
34
    @Override
35
    public void init(FilterConfig config) throws ServletException {
36
    }
×
37

38
    @Override
39
    public void doFilter(ServletRequest request, ServletResponse response,
40
        FilterChain chain) throws IOException, ServletException {
41
        HttpServletResponse httpResponse = (HttpServletResponse) response;
×
42
        httpResponse.setCharacterEncoding("UTF-8");
×
43
        httpResponse.setContentType("application/json; charset=utf-8");
×
44
        httpResponse.setHeader("WWW-Authenticate", "Basic realm=\"rocketmq\"");
×
45
        chain.doFilter(request, response);
×
46
    }
×
47

48
    @Override
49
    public void destroy() {
50
    }
×
51
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc