508 Loop Detected
WebDAV error. The server detected an infinite loop while processing the request.
When and Why to Use It
Section titled “When and Why to Use It”WebDAV specific. Use this to prevent your server from getting stuck in an infinite loop while trying to traverse heavily linked directories.
Usage Examples
Section titled “Usage Examples”import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => { throw new HttpException('Loop Detected', 508);});import { Controller, Get, HttpException } from 'shokupan';
@Controller('/api')export class ExampleController { @Get('/resource') getResource() { throw new HttpException('Loop Detected', 508); }}import express from 'express';const app = express();
app.get('/resource', (req, res) => { res.status(508).json({ error: 'Loop Detected' });});import { Controller, Get, HttpException } from '@nestjs/common';
@Controller('api')export class ExampleController { @Get('resource') getResource() { throw new HttpException('Loop Detected', 508); }}import Koa from 'koa';const app = new Koa();
app.use(async ctx => { if (ctx.path === '/resource' && ctx.method === 'GET') { ctx.status = 508; ctx.body = { error: 'Loop Detected' }; }});