Home
last modified time | relevance | path

Searched refs:req (Results 1 – 25 of 69) sorted by relevance

123

/expo/apps/bare-expo/
H A Dmetro.config.js13 return (req, res, next) => {
18 if (req.url.startsWith(assets)) {
19 req.url = req.url.replace(assets, `/assets/../..${assets}`);
25 if (req.url.startsWith(testSuiteAssets)) {
26 req.url = req.url.replace(testSuiteAssets, '/assets/../test-suite/assets/');
31 if (req.url.startsWith(nclAssets)) {
32 req.url = req.url.replace(nclAssets, '/assets/../native-component-list/');
35 return middleware(req, res, next);
/expo/apps/test-suite/
H A Dmetro.config.js14 return (req, res, next) => {
19 if (req.url.startsWith(assets)) {
20 req.url = req.url.replace(assets, `/assets/../..${assets}`);
26 if (req.url.startsWith(testSuiteAssets)) {
27 req.url = req.url.replace(testSuiteAssets, '/assets/../test-suite/assets/');
30 return middleware(req, res, next);
/expo/ios/versioned-react-native/ABI48_0_0/ReactNative/ReactCommon/hermes/inspector/chrome/
H A DABI48_0_0Connection.cpp291 if (req) { in sendMessage()
543 req.id, in handle()
545 req.reportProgress && *req.reportProgress, in handle()
606 req.id, in handle()
608 req.reportProgress && *req.reportProgress, in handle()
738 runInExecutor(req.id, [this, id = req.id]() { in handle()
747 runInExecutor(req.id, [this, id = req.id, hermesRT]() { in handle()
1169 req.id, "Unknown breakpoint ID: " + req.breakpointId); in handle()
1293 resp.id = req.id; in handle()
1310 req.id, "Unknown pause-on-exception state: " + req.state); in handle()
[all …]
H A DABI48_0_0MessageTypes.h116 virtual void handle(const UnknownRequest &req) = 0;
118 virtual void handle(const debugger::EnableRequest &req) = 0;
120 virtual void handle(const debugger::PauseRequest &req) = 0;
122 virtual void handle(const debugger::ResumeRequest &req) = 0;
143 virtual void handle(const profiler::StartRequest &req) = 0;
144 virtual void handle(const profiler::StopRequest &req) = 0;
156 void handle(const UnknownRequest &req) override {} in handle()
158 void handle(const debugger::EnableRequest &req) override {} in handle()
160 void handle(const debugger::PauseRequest &req) override {} in handle()
183 void handle(const profiler::StartRequest &req) override {} in handle()
[all …]
/expo/ios/versioned-react-native/ABI49_0_0/ReactNative/ReactCommon/hermes/inspector/chrome/
H A DABI49_0_0Connection.cpp292 if (req) { in sendMessage()
544 req.id, in handle()
546 req.reportProgress && *req.reportProgress, in handle()
607 req.id, in handle()
609 req.reportProgress && *req.reportProgress, in handle()
739 runInExecutor(req.id, [this, id = req.id]() { in handle()
748 runInExecutor(req.id, [this, id = req.id, hermesRT]() { in handle()
1169 req.id, "Unknown breakpoint ID: " + req.breakpointId); in handle()
1293 resp.id = req.id; in handle()
1310 req.id, "Unknown pause-on-exception state: " + req.state); in handle()
[all …]
H A DABI49_0_0MessageTypes.h115 virtual void handle(const UnknownRequest &req) = 0;
117 virtual void handle(const debugger::EnableRequest &req) = 0;
119 virtual void handle(const debugger::PauseRequest &req) = 0;
121 virtual void handle(const debugger::ResumeRequest &req) = 0;
142 virtual void handle(const profiler::StartRequest &req) = 0;
143 virtual void handle(const profiler::StopRequest &req) = 0;
155 void handle(const UnknownRequest &req) override {} in handle()
157 void handle(const debugger::EnableRequest &req) override {} in handle()
159 void handle(const debugger::PauseRequest &req) override {} in handle()
182 void handle(const profiler::StartRequest &req) override {} in handle()
[all …]
/expo/packages/@expo/server/src/vendor/
H A Dexpress.ts14 req: express.Request,
28 return async (req: express.Request, res: express.Response, next: express.NextFunction) => {
29 if (!req?.url || !req.method) {
33 const request = convertRequest(req, res);
64 export function convertRequest(req: express.Request, res: express.Response): ExpoRequest {
65 const url = new URL(`${req.protocol}://${req.get('host')}${req.url}`);
72 method: req.method,
73 headers: convertHeaders(req.headers),
79 if (req.method !== 'GET' && req.method !== 'HEAD') {
80 init.body = req;
H A Dhttp.ts15 req: http.IncomingMessage,
29 return async (req: http.IncomingMessage, res: http.ServerResponse, next: NextFunction) => {
30 if (!req?.url || !req.method) {
34 const request = convertRequest(req, res);
48 export function convertRequest(req: http.IncomingMessage, res: http.ServerResponse): ExpoRequest {
49 const url = new URL(req.url!, `http://${req.headers.host}`);
56 method: req.method,
57 headers: convertHeaders(req.headers),
63 if (req.method !== 'GET' && req.method !== 'HEAD') {
64 init.body = req;
/expo/ios/versioned-react-native/ABI47_0_0/ReactNative/ReactCommon/hermes/inspector/chrome/
H A DABI47_0_0Connection.cpp284 if (req) { in sendMessage()
537 req.id, in handle()
539 req.reportProgress && *req.reportProgress, in handle()
600 req.id, in handle()
602 req.reportProgress && *req.reportProgress, in handle()
740 runInExecutor(req.id, [this, id = req.id]() { in handle()
755 runInExecutor(req.id, [this, id = req.id, hermesRT]() { in handle()
1141 req.id, "Unknown breakpoint ID: " + req.breakpointId); in handle()
1265 resp.id = req.id; in handle()
1282 req.id, "Unknown pause-on-exception state: " + req.state); in handle()
[all …]
/expo/packages/@expo/cli/src/start/server/middleware/inspector/
H A DcreateJsInspectorMiddleware.ts11 return async function (req: IncomingMessage, res: ServerResponse, next: (err?: Error) => void) {
12 const { origin, searchParams } = new URL(req.url ?? '/', getServerBase(req));
30 if (req.method === 'GET') {
38 } else if (req.method === 'POST' || req.method === 'PUT') {
59 function getServerBase(req: IncomingMessage): string {
61 req.socket instanceof TLSSocket && req.socket.encrypted === true ? 'https' : 'http';
62 const { localAddress, localPort } = req.socket;
/expo/packages/@expo/server/build/vendor/
H A Dexpress.js12 return async (req, res, next) => {
13 if (!req?.url || !req.method) {
17 const request = convertRequest(req, res);
46 function convertRequest(req, res) { argument
47 const url = new URL(`${req.protocol}://${req.get('host')}${req.url}`);
52 method: req.method,
53 headers: convertHeaders(req.headers),
58 if (req.method !== 'GET' && req.method !== 'HEAD') {
59 init.body = req;
H A Dhttp.js12 return async (req, res, next) => {
13 if (!req?.url || !req.method) {
17 const request = convertRequest(req, res);
30 function convertRequest(req, res) { argument
31 const url = new URL(req.url, `http://${req.headers.host}`);
36 method: req.method,
37 headers: convertHeaders(req.headers),
42 if (req.method !== 'GET' && req.method !== 'HEAD') {
43 init.body = req;
/expo/packages/@expo/cli/src/start/server/middleware/
H A DExpoMiddleware.ts17 _shouldHandleRequest(req: ServerRequest): boolean {
18 if (!req.url) {
21 const parsed = parse(req.url);
31 req: ServerRequest,
39 req: ServerRequest,
44 return await this.handleRequestAsync(req, res, next);
60 const middleware = async (req: ServerRequest, res: ServerResponse, next: ServerNext) => {
61 if (!this._shouldHandleRequest(req)) {
64 return internalMiddleware(req, res, next);
H A DContextModuleSourceMapsMiddleware.ts14 return (req: ServerRequest, res: ServerResponse, next: any) => {
15 if (!req?.url || (req.method !== 'GET' && req.method !== 'HEAD')) {
19 if (req.url.match(/%3Fctx=[\d\w\W]+\.map\?/)) {
20 debug('Skipping sourcemap request for context module %s', req.url);
H A DServeStaticMiddleware.ts23 return (req: ServerRequest, res: ServerResponse, next: any) => {
24 if (!req?.url || (req.method !== 'GET' && req.method !== 'HEAD')) {
28 const platform = parsePlatformHeader(req);
34 const pathname = parse(req.url).pathname;
40 const stream = send(req, pathname, opts);
H A DremoteDevtoolsSecurityHeadersMiddleware.ts6 req: IncomingMessage,
12 typeof req.headers.origin === 'string' &&
13 !req.headers.origin.match(/^https?:\/\/localhost:/) &&
14 !req.headers.origin.match(/^https:\/\/chrome-devtools-frontend\.appspot\.com/)
18 `Unauthorized request from ${req.headers.origin}. ` +
H A DresolvePlatform.ts21 export function parsePlatformHeader(req: ServerRequest): string | null {
22 const url = parse(req.url!, /* parseQueryString */ true);
24 url.query?.platform || req.headers['expo-platform'] || req.headers['exponent-platform'];
29 export function resolvePlatformFromUserAgentHeader(req: ServerRequest): string | null {
31 const userAgent = req.headers['user-agent'];
H A DHistoryFallbackMiddleware.ts11 req: ServerRequest,
17 return (req: ServerRequest, res: ServerResponse, next: any) => {
18 const platform = parsePlatformHeader(req);
23 return this.indexMiddleware(req, res, next);
/expo/packages/@expo/cli/src/utils/analytics/
H A DmetroDebuggerMiddleware.ts24 return (req: Request, res: Response, next: Next) => {
31 return (req: Request, res: Response, next: Next) => {
37 const debugTool = findDebugTool(req);
51 req: Pick<Parameters<Middleware>[0], 'headers' | 'url'>
53 if (req.headers['origin']?.includes('chrome-devtools')) {
57 if (req.url?.startsWith('/json')) {
58 const flipperUserAgent = req.headers['user-agent']?.match(/(Flipper)\/([^\s]+)/);
/expo/packages/@expo/cli/src/start/server/middleware/inspector/__tests__/
H A DcreateJsInspectorMiddleware-test.ts14 const req = createRequest(`http://localhost:8081/inspector?applicationId=${app.description}`); constant
24 await middlewareAsync(req, res as ServerResponse, next);
31 const req = createRequest( constant
43 await middlewareAsync(req, res as ServerResponse, next);
59 await middlewareAsync(req, res as ServerResponse, next);
65 const req = createRequest('http://localhost:8081/inspector'); constant
70 await middlewareAsync(req, res as ServerResponse, next);
77 const req = createRequest( constant
90 await middlewareAsync(req, res as ServerResponse, next);
99 const req: Partial<IncomingMessage> = { constant
[all …]
/expo/packages/@expo/cli/src/utils/analytics/__tests__/
H A DmetroDebuggerMiddleware-test.ts19 const req = (options: { url: string; userAgent?: string; origin?: string }) => constant
30 expect(findDebugTool(req({ url: '/json', userAgent: FLIPPER_UA }))).toMatchObject({
37 expect(findDebugTool(req({ url: '/index.map', origin: CHROME_ORIGIN }))).toMatchObject({
48 middleware(req({ url: '/json', userAgent: FLIPPER_UA }), {} as any, next);
57 middleware(req({ url: '/json', userAgent: FLIPPER_UA }), {} as any, next);
58 middleware(req({ url: '/json', userAgent: FLIPPER_UA }), {} as any, next);
68 middleware(req({ url: '/json', userAgent: 'unknown/4.2.0' }), {} as any, next);
79 middleware(req({ url: '/json', userAgent: FLIPPER_UA }), {} as any, next);
91 middleware(req({ url: '/json', userAgent: FLIPPER_UA }), {} as any, next);
/expo/packages/expo-dev-menu/
H A Dmetro.config.js7 return (req, res, next) => {
8 const url = new URL(req.url, `http://${req.headers.host}`);
13 if (platform === 'android' && /\/assets\/.+\.(png|jpg|jpeg)\?.+$/.test(req.url)) {
14 req.url = `/assets/../${req.url}`;
17 return middleware(req, res, next);
/expo/packages/@expo/cli/src/api/rest/cache/
H A DwrapFetchWithCache.ts115 function getRequestCacheKey(req: any) {
117 cache: req.cache,
118 credentials: req.credentials,
119 destination: req.destination,
120 headers: req.headers,
121 integrity: req.integrity,
122 method: req.method,
123 redirect: req.redirect,
124 referrer: req.referrer,
125 referrerPolicy: req.referrerPolicy,
[all …]
/expo/home/
H A Dmetro.config.js16 return (req, res, next) => {
21 if (req.url.startsWith(assets)) {
22 req.url = req.url.replace(assets, `/assets/..${assets}`);
25 return middleware(req, res, next);
/expo/packages/@expo/cli/src/start/server/middleware/__tests__/
H A DCreateFileMiddleware-test.ts6 const asReq = (req: Partial<ServerRequest>) => req as ServerRequest;
16 middleware['parseRawBody'] = jest.fn((req) => JSON.parse((req as any).body));
32 for (const req of [ constant
37 expect(middleware._shouldHandleRequest(req)).toBe(false);
41 for (const req of [asReq({ url: 'http://localhost:8081/_expo/touch' })]) { constant
42 expect(middleware._shouldHandleRequest(req)).toBe(true);

123