main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
905 bytes
|
Line | |
---|
1 | import stampit from 'stampit';
|
---|
2 | import { NotImplementedError } from '@swagger-api/apidom-error';
|
---|
3 | import Resolver from "./Resolver.mjs";
|
---|
4 | import * as url from "../../util/url.mjs";
|
---|
5 | const HttpResolver = stampit(Resolver, {
|
---|
6 | props: {
|
---|
7 | timeout: 5000,
|
---|
8 | redirects: 5,
|
---|
9 | withCredentials: false
|
---|
10 | },
|
---|
11 | init({
|
---|
12 | timeout = this.timeout,
|
---|
13 | redirects = this.redirects,
|
---|
14 | withCredentials = this.withCredentials
|
---|
15 | } = {}) {
|
---|
16 | this.timeout = timeout;
|
---|
17 | this.redirects = redirects;
|
---|
18 | this.withCredentials = withCredentials;
|
---|
19 | },
|
---|
20 | methods: {
|
---|
21 | canRead(file) {
|
---|
22 | return url.isHttpUrl(file.uri);
|
---|
23 | },
|
---|
24 | async read() {
|
---|
25 | throw new NotImplementedError('read method in HttpResolver stamp is not yet implemented.');
|
---|
26 | },
|
---|
27 | getHttpClient() {
|
---|
28 | throw new NotImplementedError('getHttpClient method in HttpResolver stamp is not yet implemented.');
|
---|
29 | }
|
---|
30 | }
|
---|
31 | });
|
---|
32 | export default HttpResolver; |
---|
Note:
See
TracBrowser
for help on using the repository browser.