Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy authored and astrobot-houston committed Apr 3, 2024
1 parent 55ddb2b commit 0a407c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/astro/src/core/app/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ export class NodeApp extends App {
const protocol =
req.headers['x-forwarded-proto'] ??
('encrypted' in req.socket && req.socket.encrypted ? 'https' : 'http');
const hostname = req.headers["x-forwarded-host"] ?? req.headers.host ?? req.headers[":authority"];
const port = req.headers["x-forwarded-port"];
const hostname =
req.headers['x-forwarded-host'] ?? req.headers.host ?? req.headers[':authority'];
const port = req.headers['x-forwarded-port'];
const url = `${protocol}://${hostname}${port ? `:${port}` : ''}${req.url}`;
const options: RequestInit = {
method: req.method || 'GET',
Expand Down
8 changes: 4 additions & 4 deletions packages/integrations/node/test/url.test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as assert from 'node:assert/strict';
import { before, describe, it } from 'node:test';
import { TLSSocket } from 'node:tls';
import * as cheerio from 'cheerio';
import nodejs from '../dist/index.js';
import { createRequestAndResponse, loadFixture } from './test-utils.js';
import * as cheerio from 'cheerio';

describe('URL', () => {
/** @type {import('./test-utils.js').Fixture} */
Expand Down Expand Up @@ -78,8 +78,8 @@ describe('URL', () => {
let { req, res, text } = createRequestAndResponse({
headers: {
'X-Forwarded-Proto': 'https',
'X-Forwarded-Host': 'abc.xyz',
'X-Forwarded-Port': '444'
'X-Forwarded-Host': 'abc.xyz',
'X-Forwarded-Port': '444',
},
url: '/',
});
Expand All @@ -90,6 +90,6 @@ describe('URL', () => {
const html = await text();
const $ = cheerio.load(html);

assert.equal($('body').text(), "https://abc.xyz:444/");
assert.equal($('body').text(), 'https://abc.xyz:444/');
});
});

0 comments on commit 0a407c4

Please sign in to comment.